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

Configure Feed

Select the types of activity you want to include in your feed.

video: sm501fb: Improve a size determination in sm501fb_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: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Markus Elfring and committed by
Bartlomiej Zolnierkiewicz
65a4df9f 965bef64

+1 -2
+1 -2
drivers/video/fbdev/sm501fb.c
··· 1932 1932 int ret; 1933 1933 1934 1934 /* allocate our framebuffers */ 1935 - 1936 - info = kzalloc(sizeof(struct sm501fb_info), GFP_KERNEL); 1935 + info = kzalloc(sizeof(*info), GFP_KERNEL); 1937 1936 if (!info) { 1938 1937 dev_err(dev, "failed to allocate state\n"); 1939 1938 return -ENOMEM;