Skip to content

Commit

Permalink
video: hgafb: fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kangjie Lu authored and Bartlomiej Zolnierkiewicz committed Apr 1, 2019
1 parent b0e999c commit ec7f6aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/video/fbdev/hgafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ static int hga_card_detect(void)
hga_vram_len = 0x08000;

hga_vram = ioremap(0xb0000, hga_vram_len);
if (!hga_vram)
goto error;

if (request_region(0x3b0, 12, "hgafb"))
release_io_ports = 1;
Expand Down

0 comments on commit ec7f6aa

Please sign in to comment.