summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBojan Prtvar <prtvar.b@gmail.com>2011-08-03 21:51:19 +0200
committerDave Airlie <airlied@redhat.com>2011-08-04 15:39:06 +0200
commit816985d4f96cda5159b6b65f3442964725030ae9 (patch)
tree30339b75f344552ef362d7b9b7aa6739673d8efc
parentdrm/radeon: clean reg header files (diff)
downloadlinux-816985d4f96cda5159b6b65f3442964725030ae9.tar.xz
linux-816985d4f96cda5159b6b65f3442964725030ae9.zip
drm/radeon: fix potential NULL dereference in drivers/gpu/drm/radeon/atom.c
kzalloc() can return NULL, so I added check for it Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/radeon/atom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index ebdb0fdb8348..e88c64417a8a 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;