瀏覽代碼

video: fbdev-MMP: Improve a size determination in path_init()

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>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Markus Elfring 7 年之前
父節點
當前提交
965bef6483
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/video/fbdev/mmp/hw/mmp_ctrl.c

+ 1 - 1
drivers/video/fbdev/mmp/hw/mmp_ctrl.c

@@ -406,7 +406,7 @@ static int path_init(struct mmphw_path_plat *path_plat,
 	dev_info(ctrl->dev, "%s: %s\n", __func__, config->name);
 
 	/* init driver data */
-	path_info = kzalloc(sizeof(struct mmp_path_info), GFP_KERNEL);
+	path_info = kzalloc(sizeof(*path_info), GFP_KERNEL);
 	if (!path_info)
 		return 0;