From patchwork Wed Sep 21 16:39:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9343875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 841936077A for ; Wed, 21 Sep 2016 16:39:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 814E82A76A for ; Wed, 21 Sep 2016 16:39:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75A3F2A7F0; Wed, 21 Sep 2016 16:39:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2AB172A76A for ; Wed, 21 Sep 2016 16:39:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5E006E86E; Wed, 21 Sep 2016 16:39:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FC146E86E for ; Wed, 21 Sep 2016 16:39:44 +0000 (UTC) Received: from [192.168.1.2] ([77.182.212.253]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0Lr2Yd-1bHWDB1V8l-00eaAe; Wed, 21 Sep 2016 18:39:38 +0200 Subject: [PATCH 02/14] GPU-DRM-OMAP: Replace another kmalloc() call by kmalloc_array() in tiler_map_show() To: dri-devel@lists.freedesktop.org, David Airlie , Laurent Pinchart , Tomi Valkeinen References: <566ABCD9.1060404@users.sourceforge.net> <0ea38611-3d93-0ade-a1fb-f8cc2e0b8d61@users.sourceforge.net> From: SF Markus Elfring Message-ID: <186b878b-b3a1-f314-c102-d1a230f7f20a@users.sourceforge.net> Date: Wed, 21 Sep 2016 18:39:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <0ea38611-3d93-0ade-a1fb-f8cc2e0b8d61@users.sourceforge.net> X-Provags-ID: V03:K0:ZA9GYnK7zkml8he164t4koSxSKP8wRb473Lbk9YlPb1J06r1osc /nchjye5esbNYGG0hWIA6HM6nYo72Yr93FyawEkI/ba5NdeSMzT0VE5UGtKU9cHxBExuMoQ EdPkF+KliZwyhB1FvBs22vhMUI1Tdj9daPgmE8/PbRQvo33E9af9fhYxs8k0sM079l8C4eX lzrb4UJoPCrvZEvvnIYWQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:0xU/j8KhmFk=:OLkmC/E6Nhb4/6wOE/LSj2 YEkvJBU4qXO8Xb1+UOkxpnjRd10gtjYOqP30VDdNxPz0wxKwc7vJ+IFdt0YCzL6ICdPva5ICm S5rl9MNRd70pVUGJHAKRYM3DdmCkKK4J8YbYrZtBCM+ytUBVIkcYAvV5QzHSwMzu9JOo/2+QL UwiQAV0QgoC3bpGz4jxQJYv2CZgzKRenW3CCajKSVmDVR6YkBDYVqACrtfDtUY2Ksu5QowJNc +2KKfk0jX43QHS8a2aMOTpjyQ7gqGdu26+gMnxpuPFllLj8x29dKsVD3P6/l0E0FeAr98R+g7 PcOE+T1dIjidfod1au1/C3ur77XIAk9rNm1XztcOes2GVn5jKWmiBrrTBQxlz0NH6zdoU2AW9 ARJ388Qc934+tlc6PK0++LTo+MQlIjLILocLIehV7JxgCa9miT42eRbwA6FRQCb/dL/CoOext ltfeEUifsetb8RHuKugNe1SOWJbZOZh3NWs2jNQ+eImEM/+FmL3mw3excBtXt8cYoNoc7cA/1 WA2awXjgR14etSyk4gMubs/8FuZHST19LlGn0hLmdW9/alk4HzcJ5CBicwUplQ957KNFIzKli PAU2C7MXMMpiSzTVyuIzXYeXiqIr6n2tG6dANHbBDR5QSgEkkPBwjLoNJVcRMMWejkNPD6dM4 7k2CeeWQJxFDQdPTAbVPvVjl0N6Lka1OjJU+4ozPMRrDcOBCTMpeQEus9jQm7RWKNHe63NgIv H47U0dqzGQAzKg+vOVEuMAc/lTGnvOGJ+0wHxEWHcAa6EF5Wx+uiU30IIbZwzAqvCXicadNEL 69mYY3b Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 21 Sep 2016 12:54:07 +0200 A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array" at another place. Signed-off-by: Markus Elfring --- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index 7b32dd3..3a4f91b 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c @@ -918,8 +918,7 @@ int tiler_map_show(struct seq_file *s, void *arg) h_adj = omap_dmm->container_height / ydiv; w_adj = omap_dmm->container_width / xdiv; map = kmalloc_array(h_adj, sizeof(*map), GFP_KERNEL); - global_map = kmalloc((w_adj + 1) * h_adj, GFP_KERNEL); - + global_map = kmalloc_array(h_adj, w_adj + 1, GFP_KERNEL); if (!map || !global_map) goto error;