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: 13110 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 882F623FC1 for ; Fri, 23 Nov 2012 03:48:37 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3C578A181DF for ; Fri, 23 Nov 2012 03:48:37 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1335312ieb.11 for ; Thu, 22 Nov 2012 19:48:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tXFr16ApX09tcCW2qZ05Cvkp6zbgivNGTVnMbfhm5r4=; b=Bj/lDL0AdCymr6Ufy35ttvqLPYyoK/Oq8LKKFyExklvRsX4UNm8ST837rdRviouaTH hHTFDOYcI/OcOqYI0Tj2YzqXRN13fY3JZDMTwmsFd1wF3WPGfxwYR37lDGAVSK1IekAw SeFbuZK9bEYpLqCPBZu/ulNVI+Q5LBukpUT2AyYHhBUX3w7IaAusQG5gRnYGBGZUnQbc McJYq1yZUO5JRfiWjGoGi00ZHg4tFW2KlCnrHY4JNHYu3OnFmYYkpPKyvQVU6gpTkUdD rf0pzYcXE3fJfT8z/PgLME2cuSfBIIlDjpmWVaX/JI7WB4lmzqle9YT0HAHu+yQzqwem Oi9g== Received: by 10.50.213.69 with SMTP id nq5mr4924100igc.70.1353642516975; Thu, 22 Nov 2012 19:48:36 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp296309igt; Thu, 22 Nov 2012 19:48:36 -0800 (PST) Received: by 10.68.130.197 with SMTP id og5mr10430326pbb.138.1353642516271; Thu, 22 Nov 2012 19:48:36 -0800 (PST) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id zk1si7315339pbc.140.2012.11.22.19.48.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 19:48:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f45.google.com with SMTP id mc8so6750760pbc.18 for ; Thu, 22 Nov 2012 19:48:36 -0800 (PST) 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 Cc: inki.dae@samsung.com, jy0922.shim@samsung.com, airlied@linux.ie, sachin.kamat@linaro.org, patches@linaro.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: ALoCoQk1WFTKuPltLatMSf4af42m3OfWQj0TuMlUSR1ZeP+GF/JuavJfyC/OR+D+wSkzlVSOv6De 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; }