Skip to content

Commit

Permalink
video: omap: Improve a size determination in omapfb_do_probe()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
  • Loading branch information
elfring authored and bzolnier committed Apr 26, 2018
1 parent 65a4df9 commit 85d108d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/fbdev/omap/omapfb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ static int omapfb_do_probe(struct platform_device *pdev,
goto cleanup;
}

fbdev = kzalloc(sizeof(struct omapfb_device), GFP_KERNEL);
fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
if (fbdev == NULL) {
dev_err(&pdev->dev,
"unable to allocate memory for device info\n");
Expand Down

0 comments on commit 85d108d

Please sign in to comment.