mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 18:12:48 +00:00
video: imsttfb: fix potential NULL pointer dereferences
In case ioremap fails, the fix releases resources and returns -ENOMEM to avoid NULL pointer dereferences. Signed-off-by: Kangjie Lu <[email protected]> Cc: Aditya Pakki <[email protected]> Cc: Finn Thain <[email protected]> Cc: Rob Herring <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> [b.zolnierkie: minor patch summary fixup] Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
This commit is contained in:
committed by
Bartlomiej Zolnierkiewicz
parent
ec7f6aad57
commit
1d84353d20
@@ -1515,6 +1515,11 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
info->fix.smem_start = addr;
|
||||
info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ?
|
||||
0x400000 : 0x800000);
|
||||
if (!info->screen_base) {
|
||||
release_mem_region(addr, size);
|
||||
framebuffer_release(info);
|
||||
return -ENOMEM;
|
||||
}
|
||||
info->fix.mmio_start = addr + 0x800000;
|
||||
par->dc_regs = ioremap(addr + 0x800000, 0x1000);
|
||||
par->cmap_regs_phys = addr + 0x840000;
|
||||
|
||||
Reference in New Issue
Block a user