]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
um: ubd: Add missing error check in start_io_thread()
authorTiwei Bie <tiwei.btw@antgroup.com>
Fri, 6 Jun 2025 12:44:25 +0000 (20:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 09:00:12 +0000 (11:00 +0200)
[ Upstream commit c55c7a85e02a7bfee20a3ffebdff7cbeb41613ef ]

The subsequent call to os_set_fd_block() overwrites the previous
return value. OR the two return values together to fix it.

Fixes: f88f0bdfc32f ("um: UBD Improvements")
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20250606124428.148164-2-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/drivers/ubd_user.c

index a1afe414ce481481adb956675783b78660a9ab46..fb5b1e7c133d8667355c381603787d99662b7101 100644 (file)
@@ -41,7 +41,7 @@ int start_io_thread(unsigned long sp, int *fd_out)
        *fd_out = fds[1];
 
        err = os_set_fd_block(*fd_out, 0);
-       err = os_set_fd_block(kernel_fd, 0);
+       err |= os_set_fd_block(kernel_fd, 0);
        if (err) {
                printk("start_io_thread - failed to set nonblocking I/O.\n");
                goto out_close;