Commit 011a0502 authored by Andrey Vatoropin's avatar Andrey Vatoropin Committed by Helge Deller
Browse files

fbcon: check return value of con2fb_acquire_newinfo()



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: d1baa4ff ("fbcon: set_con2fb_map fixes")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarAndrey Vatoropin <a.vatoropin@crpt.ru>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 40227f2e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1068,7 +1068,8 @@ static void fbcon_init(struct vc_data *vc, bool init)
		return;

	if (!info->fbcon_par)
		con2fb_acquire_newinfo(vc, info, vc->vc_num);
		if (con2fb_acquire_newinfo(vc, info, vc->vc_num))
			return;

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