summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sun4i
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2017-02-17 11:13:27 +0800
committerMaxime Ripard <maxime.ripard@free-electrons.com>2017-03-07 22:15:15 +0100
commitf43fbe7a59b6e2fd8b366321e5163c3499b80b26 (patch)
tree5ab0cb86ed4cebc892ed68cff508194675c139a9 /drivers/gpu/drm/sun4i
parent92b300c4e6f7f6fc22e1cc02d7c07627769a6339 (diff)
downloadlinux-f43fbe7a59b6e2fd8b366321e5163c3499b80b26.tar.bz2
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>
Diffstat (limited to 'drivers/gpu/drm/sun4i')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_layer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 5d53c977bca5..62552a356d66 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -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);