From 816985d4f96cda5159b6b65f3442964725030ae9 Mon Sep 17 00:00:00 2001 From: Bojan Prtvar Date: Wed, 3 Aug 2011 19:51:19 +0000 Subject: [PATCH] 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 Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/atom.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.5