Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

video: ARM CLCD: Improve a size determination in clcdfb_probe()

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 <elfring@users.sourceforge.net>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Markus Elfring and committed by
Bartlomiej Zolnierkiewicz
d6f58616 c97d7879

+1 -1
+1 -1
drivers/video/fbdev/amba-clcd.c
··· 967 967 goto out; 968 968 } 969 969 970 - fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL); 970 + fb = kzalloc(sizeof(*fb), GFP_KERNEL); 971 971 if (!fb) { 972 972 ret = -ENOMEM; 973 973 goto free_region;