From patchwork Wed Jan 16 23:43:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 1993821 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 944423FC85 for ; Thu, 17 Jan 2013 00:10:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6514BE6B81 for ; Wed, 16 Jan 2013 16:10:59 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 397 seconds by postgrey-1.32 at gabe; Wed, 16 Jan 2013 15:49:49 PST Received: from g6t0185.atlanta.hp.com (g6t0185.atlanta.hp.com [15.193.32.62]) by gabe.freedesktop.org (Postfix) with ESMTP id CEEC4E6059 for ; Wed, 16 Jan 2013 15:49:49 -0800 (PST) Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g6t0185.atlanta.hp.com (Postfix) with ESMTP id 7819E244DB; Wed, 16 Jan 2013 23:43:11 +0000 (UTC) Received: from [10.152.0.194] (swa01cs006-da01.atlanta.hp.com [16.114.29.156]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id 37FED2012F; Wed, 16 Jan 2013 23:43:08 +0000 (UTC) Message-ID: <1358379788.7243.10.camel@lorien2> Subject: [PATCH] drm/radeon: fix NULL pointer dereference in UMS mode in radeon_cs_parser_fini() From: Shuah Khan To: airlied@linux.ie, deathsimple@vodafone.de, jglisse@redhat.com, airlied@redhat.com, alexander.deucher@amd.com Date: Wed, 16 Jan 2013 16:43:08 -0700 Organization: ISS-Linux X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Mailman-Approved-At: Wed, 16 Jan 2013 16:08:53 -0800 Cc: Greg KH , LKML , dri-devel@lists.freedesktop.org, shuahkhan@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: shuah.khan@hp.com List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Fix parser->rdev NULL pointer dereference in radeon_cs_parser_fini(). While back-porting drm/radeon: fix NULL pointer dereference in UMS mode patch (commit-id: ff4bd0827764e10a428a9d39e6814c5478863f94) to 3,7.y, noticed another instance of NULL pointer dereference in radeon_cs_parser_fini() function. Signed-off-by: Shuah Khan CC: stable@vger.kernel.org 3.7 --- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 469661f..d1c282c 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -329,7 +329,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error) kfree(parser->relocs_ptr); for (i = 0; i < parser->nchunks; i++) { kfree(parser->chunks[i].kdata); - if ((parser->rdev->flags & RADEON_IS_AGP)) { + if (parser->rdev && (parser->rdev->flags & RADEON_IS_AGP)) { kfree(parser->chunks[i].kpage[0]); kfree(parser->chunks[i].kpage[1]); }