]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbcon: check return value of con2fb_acquire_newinfo()
authorAndrey Vatoropin <a.vatoropin@crpt.ru>
Wed, 17 Dec 2025 09:11:05 +0000 (09:11 +0000)
committerHelge Deller <deller@gmx.de>
Sat, 14 Feb 2026 10:07:12 +0000 (11:07 +0100)
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: d1baa4ffa677 ("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>
drivers/video/fbdev/core/fbcon.c

index 34ea14412ace129641556a9ad2c4b1b96de4a818..36e380797a9e4dabfe8938d14e1a925a27680b19 100644 (file)
@@ -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 */