From: Markus Elfring Date: Fri, 8 Sep 2017 20:30:09 +0000 (-0700) Subject: media: s5p-mfc: Improve a size determination in s5p_mfc_alloc_memdev() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d7f15bde0f25ee8a5ea3aad96522ba851a47a0b0;p=openwrt%2Fstaging%2Fblogic.git media: s5p-mfc: Improve a size determination in s5p_mfc_alloc_memdev() Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 8af45d53846f..abfb70b07032 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1083,7 +1083,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev, struct device *child; int ret; - child = devm_kzalloc(dev, sizeof(struct device), GFP_KERNEL); + child = devm_kzalloc(dev, sizeof(*child), GFP_KERNEL); if (!child) return NULL;