public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Bojan Prtvar <prtvar.b@gmail.com>
To: airlied@linux.ie
Cc: alexdeucher@gmail.com, airlied@redhat.com,
	akpm@linux-foundation.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Bojan Prtvar <prtvar.b@gmail.com>
Subject: [PATCH] Fix potential NULL dereference in drivers/gpu/drm/radeon/atom.c
Date: Wed, 03 Aug 2011 19:51:19 +0000	[thread overview]
Message-ID: <1312401079-1775-1-git-send-email-prtvar.b@gmail.com> (raw)

kzalloc() can return NULL, so I added check for it

Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
---
 drivers/gpu/drm/radeon/atom.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index ebdb0fd..e88c644 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -1245,6 +1245,9 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
 	char name[512];
 	int i;
 
+	if (!ctx)
+		return NULL;
+
 	ctx->card = card;
 	ctx->bios = bios;
 
-- 
1.7.1


                 reply	other threads:[~2011-08-03 19:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1312401079-1775-1-git-send-email-prtvar.b@gmail.com \
    --to=prtvar.b@gmail.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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