Skip to contentSkip to conversation

Fix potential NULL dereference in drivers/gpu/drm/radeon/atom.c

PATCH New Bojan Prtvar 1 participant 1 message Aug 3, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix potential NULL dereference in drivers/gpu/drm/radeon/atom.c

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

---
 drivers/gpu/drm/radeon/atom.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/atom.c +3 -0
index ebdb0fd..e88c644 100644
@@ -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;
 
Signature · 1 line
1.7.1