drm/radeon: fix potential NULL dereference in drivers/gpu/drm/radeon/atom.c
Bojan Prtvar [Wed, 3 Aug 2011 19:51:19 +0000 (19:51 +0000)]
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>

drivers/gpu/drm/radeon/atom.c

index ebdb0fd..e88c644 100644 (file)
@@ -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;