Re: [PATCH 4/7] drm/sun4i: Fix kcalloc element size in sun4i_layers_init

2017-02-21 Thread Maxime Ripard
On Fri, Feb 17, 2017 at 11:13:27AM +0800, Chen-Yu Tsai wrote: > 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

[PATCH 4/7] drm/sun4i: Fix kcalloc element size in sun4i_layers_init

2017-02-17 Thread Chen-Yu Tsai
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.