瀏覽代碼

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>
Bojan Prtvar 14 年之前
父節點
當前提交
816985d4f9
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/gpu/drm/radeon/atom.c

+ 3 - 0
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;