From patchwork Thu Sep 27 10:26:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 1512781 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id CB77EDFE80 for ; Thu, 27 Sep 2012 10:26:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B27D59ECE7 for ; Thu, 27 Sep 2012 03:26:35 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 9138F9EC4F for ; Thu, 27 Sep 2012 03:26:04 -0700 (PDT) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MB000EEK7N1DHJ0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 27 Sep 2012 19:26:03 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-9e-506429bbd5d0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 2E.53.03783.BB924605; Thu, 27 Sep 2012 19:26:03 +0900 (KST) Received: from localhost.localdomain ([10.90.51.60]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MB0006CE7NFO280@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 27 Sep 2012 19:26:03 +0900 (KST) From: Joonyoung Shim To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: fix kcalloc size of g2d cmdlist node Date: Thu, 27 Sep 2012 19:26:03 +0900 Message-id: <1348741563-15779-1-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFJMWRmVeSWpSXmKPExsVy+t9jAd3dmikBBt9OSVhc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujJ3bZzAW9LFX7Pt6jrGBsZGti5GTQ0LARKJj3Vp2CFtM4sK9 9UBxLg4hgUWMElt6v7JCOCuYJN5ePswMUsUmoCdxZ9txJhBbREBZ4u/EVYwgNrOAsUTH/C+s ILawgKPE5B/zwWwWAVWJL+87wXp5Bdwlln+/DFTPAbRNQWLOJJsJjNwLGBlWMYqmFiQXFCel 5xrqFSfmFpfmpesl5+duYgT78JnUDsaVDRaHGAU4GJV4eAPckwOEWBPLiitzDzFKcDArifBG qaYECPGmJFZWpRblxxeV5qQWH2KU5mBREucV/hQYICSQnliSmp2aWpBaBJNl4uCUamCcmFvH dlBhut7cTI/jZ38s2KrXsH96w4tVFWGMn+P3a8zr8D4fWWwuWFYpFl1lNcM5SMiZg4OVz+3Q hKmhFl1WVyy/9p9S+7DmzsSOuNjuHyf5+fo13/gq9+3tNVr588Kb9wp5EgWX7H5IJtqeOKVS VtcdKL7u8wbGIuOt7guNTn/T9zWfGaPEUpyRaKjFXFScCADqT9lC3QEAAA== Cc: kyungmin.park@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org The size argument means just one element size when we call kcalloc, so G2D_CMDLIST_NUM * sizeof(*node) is wrong. Signed-off-by: Joonyoung Shim Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index dcbc4cb..3fbe591 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -165,8 +165,7 @@ static int g2d_init_cmdlist(struct g2d_data *g2d) return -ENOMEM; } - node = kcalloc(G2D_CMDLIST_NUM, G2D_CMDLIST_NUM * sizeof(*node), - GFP_KERNEL); + node = kcalloc(G2D_CMDLIST_NUM, sizeof(*node), GFP_KERNEL); if (!node) { dev_err(dev, "failed to allocate memory\n"); ret = -ENOMEM;