Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

video: hgafb: fix potential NULL pointer dereference

When ioremap fails, hga_vram should not be dereferenced. The fix
check the failure to avoid NULL pointer dereference.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Cc: Aditya Pakki <pakki001@umn.edu>
Cc: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
[b.zolnierkie: minor patch summary fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Kangjie Lu and committed by
Bartlomiej Zolnierkiewicz
ec7f6aad b0e999c9

+2
+2
drivers/video/fbdev/hgafb.c
··· 285 285 hga_vram_len = 0x08000; 286 286 287 287 hga_vram = ioremap(0xb0000, hga_vram_len); 288 + if (!hga_vram) 289 + goto error; 288 290 289 291 if (request_region(0x3b0, 12, "hgafb")) 290 292 release_io_ports = 1;