]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tty/vt: Add missing return value for VT_RESIZE in vt_ioctl()
authorZizhi Wo <wozizhi@huaweicloud.com>
Thu, 4 Sep 2025 02:39:55 +0000 (10:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:15 +0000 (15:37 -0500)
[ Upstream commit da7e8b3823962b13e713d4891e136a261ed8e6a2 ]

In vt_ioctl(), the handler for VT_RESIZE always returns 0, which prevents
users from detecting errors. Add the missing return value so that errors
can be properly reported to users like vt_resizex().

Signed-off-by: Zizhi Wo <wozizhi@huaweicloud.com>
Link: https://lore.kernel.org/r/20250904023955.3892120-1-wozizhi@huaweicloud.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/vt/vt_ioctl.c

index 61342e06970a00c024d8eceec7915bf685a18cb6..eddb25bec996ed0f0f87f87699e83e2b29c6612b 100644 (file)
@@ -923,7 +923,9 @@ int vt_ioctl(struct tty_struct *tty,
 
                        if (vc) {
                                /* FIXME: review v tty lock */
-                               __vc_resize(vc_cons[i].d, cc, ll, true);
+                               ret = __vc_resize(vc_cons[i].d, cc, ll, true);
+                               if (ret)
+                                       return ret;
                        }
                }
                console_unlock();