Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
bcbdfc7f 56dd2908

+5 -2
+5 -2
drivers/usb/misc/iowarrior.c
··· 362 362 size_t count, loff_t *ppos) 363 363 { 364 364 struct iowarrior *dev; 365 - int retval = 0; 365 + int retval; 366 366 char *buf = NULL; /* for IOW24 and IOW56 we need a buffer */ 367 367 struct urb *int_out_urb = NULL; 368 368 369 369 dev = file->private_data; 370 370 371 - mutex_lock(&dev->mutex); 371 + retval = mutex_lock_interruptible(&dev->mutex); 372 + if (retval < 0) 373 + return -EINTR; 374 + 372 375 /* verify that the device wasn't unplugged */ 373 376 if (!dev->present) { 374 377 retval = -ENODEV;