diff options
author | Bojan Prtvar <prtvar.b@gmail.com> | 2011-08-03 15:51:19 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-08-04 09:39:06 -0400 |
commit | 816985d4f96cda5159b6b65f3442964725030ae9 (patch) | |
tree | 30339b75f344552ef362d7b9b7aa6739673d8efc /drivers/gpu | |
parent | 69ad2ffe57a81c7b700e337f066b8b39c3655910 (diff) |
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | 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 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) | |||
1245 | char name[512]; | 1245 | char name[512]; |
1246 | int i; | 1246 | int i; |
1247 | 1247 | ||
1248 | if (!ctx) | ||
1249 | return NULL; | ||
1250 | |||
1248 | ctx->card = card; | 1251 | ctx->card = card; |
1249 | ctx->bios = bios; | 1252 | ctx->bios = bios; |
1250 | 1253 | ||