Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29ba8c8a authored by Martin Peres's avatar Martin Peres Committed by Ben Skeggs
Browse files

drm/nouveau/bios: fix a potential NULL deref in the PROM shadowing function

parent 9044fa60
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -183,10 +183,11 @@ nouveau_bios_shadow_prom(struct nouveau_bios *bios)
		goto out;

	bios->data = kmalloc(bios->size, GFP_KERNEL);
	if (bios->data) {
	if (!bios->data)
		goto out;

	for (i = 0; i < bios->size; i += 4)
		((u32 *)bios->data)[i/4] = nv_rd32(bios, 0x300000 + i);
	}

	/* check the PCI record header */
	pcir = nv_ro16(bios, 0x0018);