From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752914AbdBUWMN (ORCPT ); Tue, 21 Feb 2017 17:12:13 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:38050 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751508AbdBUWMF (ORCPT ); Tue, 21 Feb 2017 17:12:05 -0500 Date: Tue, 21 Feb 2017 14:12:01 -0800 From: Maxime Ripard To: Chen-Yu Tsai Cc: David Airlie , dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/7] drm/sun4i: Fix kcalloc element size in sun4i_layers_init Message-ID: <20170221221201.53pjfhvetaw32c7h@lukather> References: <20170217031330.14087-1-wens@csie.org> <20170217031330.14087-5-wens@csie.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ejgv6cgz7qcklc3y" Content-Disposition: inline In-Reply-To: <20170217031330.14087-5-wens@csie.org> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ejgv6cgz7qcklc3y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > layers =3D devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes), > sizeof(**layers), GFP_KERNEL); >=20 > 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. >=20 > Signed-off-by: Chen-Yu Tsai Applied, thanks! Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --ejgv6cgz7qcklc3y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYrLsxAAoJEBx+YmzsjxAgSMgQALuTJPL6eTWmlDcNoELVoLjb ycr8oAA4LSKdtH8M8GVj+R1g8atJ6wq9KUsJ1BEom+H8t2wkpft+DyXFUaHy/yBJ q6N05mjYfoLPcJytX48zwf/ZCfpIzxFLeVD4VrL7qVevRtcYoHOKLL5Q8Js3Lb8N Up/QPAgMDoPfZuleXo0AU4L+YY1GhdjNO7wr2WYSvSaXFoEJjyrkOUrAAll3IVmR yR50mtwxw4rYXJ0sf9/hjtpEQYYKctT0B6UUZ92ZC+kOzSD7DG8pg9av4odoUt7n IsMXsCxAAKqV1prhiilWsLQHm7y0FzK4Oc1GVtUcwQAV3EcFiEyrhCBfL2zNclRo o8OMMVWUIPqXVgg6jU/yKgdZar5uAfaeGhcRVBbhfoCMHFokHO00m8+CH/9sEqRx NH7s9uWaByEq1Ftl5gCNB8uKRjQoPMD/RtUOZsIFFExSSS+4l9wPk4S4/3eTMHWD Zl2nVHHNxVrtTRiLrxS1WsK0gxsRm9tNvrJcklL9f+jDfNQr+tiR0lArnf8Ie+NL SkUM7yEAVzcsJxfgCwWVe7xiWrw4vYqbh5AO03kge+2wutmPAc3Y7NC79UZ2loIv A3OIAN7GfUO0fVwkaVllSnOw3DG4/b7HVVm4yrL063D/URvExJcI3z85XoSzhMTb k/dvkHRiyziWgEME/aFA =zvyV -----END PGP SIGNATURE----- --ejgv6cgz7qcklc3y--