drm/sun4i: Fix kcalloc element size in sun4i_layers_init

In sun4i_layers_init we are allocating an array of pointers to struct
sun4i_layer:

	layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes),
	                      sizeof(**layers), GFP_KERNEL);

The element size should be the size of an individual element of the
array. Change it to sizeof(*layers) to avoid wasting a lot of memory.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
这个提交包含在:
Chen-Yu Tsai
2017-02-17 11:13:27 +08:00
提交者 Maxime Ripard
父节点 92b300c4e6
当前提交 f43fbe7a59

查看文件

@@ -140,7 +140,7 @@ struct sun4i_layer **sun4i_layers_init(struct drm_device *drm)
int i;
layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes),
sizeof(**layers), GFP_KERNEL);
sizeof(*layers), GFP_KERNEL);
if (!layers)
return ERR_PTR(-ENOMEM);