Skip to content

Commit f57b616

Browse files
Andrey VatoropinSasha Levin
authored andcommitted
fbcon: check return value of con2fb_acquire_newinfo()
[ Upstream commit 011a050 ] If fbcon_open() fails when called from con2fb_acquire_newinfo() then info->fbcon_par pointer remains NULL which is later dereferenced. Add check for return value of the function con2fb_acquire_newinfo() to avoid it. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d1baa4f ("fbcon: set_con2fb_map fixes") Cc: stable@vger.kernel.org Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru> Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8d9fda6 commit f57b616

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/video/fbdev/core/fbcon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,8 @@ static void fbcon_init(struct vc_data *vc, bool init)
10681068
return;
10691069

10701070
if (!info->fbcon_par)
1071-
con2fb_acquire_newinfo(vc, info, vc->vc_num);
1071+
if (con2fb_acquire_newinfo(vc, info, vc->vc_num))
1072+
return;
10721073

10731074
/* If we are not the first console on this
10741075
fb, copy the font from that console */

0 commit comments

Comments
 (0)