mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
fbdev: viafb: check ioremap return value in viafb_lcd_get_mobile_state
The function viafb_lcd_get_mobile_state() calls ioremap() without checking the return value. If ioremap() fails (returns NULL), the subsequent readw() will cause a NULL pointer dereference. Signed-off-by: Wang Jun <1742789905@qq.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
db65872b38
commit
f044788088
|
|
@ -954,6 +954,9 @@ bool viafb_lcd_get_mobile_state(bool *mobile)
|
|||
u16 start_pattern;
|
||||
|
||||
biosptr = ioremap(romaddr, 0x10000);
|
||||
if (!biosptr)
|
||||
return false;
|
||||
|
||||
start_pattern = readw(biosptr);
|
||||
|
||||
/* Compare pattern */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user