From patchwork Fri Nov 23 03:41:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1793941 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 CEEE0DF230 for ; Fri, 23 Nov 2012 06:44:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D84CAE6416 for ; Thu, 22 Nov 2012 22:44:34 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 154AAE5F3B for ; Thu, 22 Nov 2012 19:48:36 -0800 (PST) Received: by mail-pb0-f49.google.com with SMTP id un15so5719577pbc.36 for ; Thu, 22 Nov 2012 19:48:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tXFr16ApX09tcCW2qZ05Cvkp6zbgivNGTVnMbfhm5r4=; b=RANPrhRzk6mRuns/7MxrccOQBe0+bnPD8fjDJRtoDcJ5NIxgp8vAmARxhpNkwpO9G0 fHTsQGYeP6mo5msUy0pszd1yY1srzNl7aaGu5pEMBIONqGUjDnjNdOiPFGrGRjCWiZb8 +/0f/EiWS4FYs02pzo3G+kWVtvz/AHgd07OfcclYVIWWqepIIkLlD8HE0hPixgHkj/8O cPqO3+WuWQeUkR+Yem+NDf7lVTBb2R0LPih0IP9Be50c7u+dXiaVvGEKbaHUqUhvsmdn 3H8i4e6DXPPfqo2FUcmLBmBBTT+HeCc44vtJSK45HlI90bBNu6LbpwjqlnMl87rgsiK+ z5ow== Received: by 10.68.202.72 with SMTP id kg8mr10568912pbc.134.1353642516031; Thu, 22 Nov 2012 19:48:36 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id x8sm2937337paw.16.2012.11.22.19.48.32 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 19:48:35 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/5] drm/exynos: Fix potential NULL pointer dereference Date: Fri, 23 Nov 2012 09:11:59 +0530 Message-Id: <1353642119-10253-6-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353642119-10253-1-git-send-email-sachin.kamat@linaro.org> References: <1353642119-10253-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQnpaiFKXmuxzjYcQOCn6/cwiF1KdFJdtn1oalddIKIJpXtU3WTmiJEmT05X705z/8PUivvJ X-Mailman-Approved-At: Thu, 22 Nov 2012 22:38:55 -0800 Cc: patches@linaro.org, sachin.kamat@linaro.org 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 Pointer was being dereferenced after freeing. Fixes the following error: drivers/gpu/drm/exynos/exynos_drm_g2d.c:323 g2d_userptr_put_dma_addr() error: dereferencing freed memory 'g2d_userptr' Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index c1054cb..6ffa076 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -319,8 +319,8 @@ out: g2d_userptr->sgt = NULL; kfree(g2d_userptr->pages); - kfree(g2d_userptr); g2d_userptr->pages = NULL; + kfree(g2d_userptr); g2d_userptr = NULL; }