diff options
| author | Oliver Neukum <oneukum@suse.com> | 2026-03-12 12:45:28 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-03-18 18:02:20 +0300 |
| commit | bcbdfc7fadf8018552fd55e57114a77637395684 (patch) | |
| tree | fa73e3526e0d8a1b2a0b7751b6ada5d277060ca7 | |
| parent | 56dd29088c9d9510c48a8ebad2465248fde36551 (diff) | |
| download | linux-bcbdfc7fadf8018552fd55e57114a77637395684.tar.xz | |
iowarrior: use interruptible lock in iowarrior_write()
The function itself, if it has to wait to perform
IO, use interruptible sleep. Hence the sleep needed
to avoid the write code path racing with itself should also
use interruptible sleep.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://patch.msgid.link/20260312094619.1590556-2-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/usb/misc/iowarrior.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 5b31e5669d53..0b377204374f 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -362,13 +362,16 @@ static ssize_t iowarrior_write(struct file *file, size_t count, loff_t *ppos) { struct iowarrior *dev; - int retval = 0; + int retval; char *buf = NULL; /* for IOW24 and IOW56 we need a buffer */ struct urb *int_out_urb = NULL; dev = file->private_data; - mutex_lock(&dev->mutex); + retval = mutex_lock_interruptible(&dev->mutex); + if (retval < 0) + return -EINTR; + /* verify that the device wasn't unplugged */ if (!dev->present) { retval = -ENODEV; |
