summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.btw@antgroup.com>2025-06-06 20:44:25 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-06 11:01:40 +0200
commite1f6654f229949c657dd8276f26030880c94456e (patch)
tree2c4519433c9d4c5b04ef95b6dfc0473d47005a2b
parentc6665b8f0f58082c480ed8627029f44d046ef2c8 (diff)
um: ubd: Add missing error check in start_io_thread()
[ 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>
-rw-r--r--arch/um/drivers/ubd_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c
index b4f8b8e60564..592b899820d6 100644
--- a/arch/um/drivers/ubd_user.c
+++ b/arch/um/drivers/ubd_user.c
@@ -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;