public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.khan@hp.com>
To: airlied@linux.ie, deathsimple@vodafone.de, jglisse@redhat.com,
	airlied@redhat.com, alexander.deucher@amd.com
Cc: dri-devel@lists.freedesktop.org,
	LKML <linux-kernel@vger.kernel.org>,
	shuahkhan@gmail.com, Greg KH <gregkh@linuxfoundation.org>
Subject: [PATCH] drm/radeon: fix NULL pointer dereference in UMS mode in radeon_cs_parser_fini()
Date: Wed, 16 Jan 2013 16:43:08 -0700	[thread overview]
Message-ID: <1358379788.7243.10.camel@lorien2> (raw)

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 <shuah.khan@hp.com>
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]);
 		}
-- 
1.7.9.5




             reply	other threads:[~2013-01-16 23:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16 23:43 Shuah Khan [this message]
2013-01-17  3:06 ` [PATCH] drm/radeon: fix NULL pointer dereference in UMS mode in radeon_cs_parser_fini() Ilija Hadzic
2013-01-17 17:09   ` Shuah Khan
2013-01-23 16:07     ` Herton Ronaldo Krzesinski
2013-01-23 17:21       ` Ilija Hadzic
2013-01-23 17:40         ` Herton Ronaldo Krzesinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358379788.7243.10.camel@lorien2 \
    --to=shuah.khan@hp.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shuahkhan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox