Skip to content

Commit 2d6d260

Browse files
oneukumgregkh
authored andcommitted
usb: mdc800: handle signal and read racing
If a signal arrives after a read has partially completed, we need to return the number of bytes read. -EINTR is correct only if that number is zero. Signed-off-by: Oliver Neukum <oneukum@suse.com> Cc: stable <stable@kernel.org> Link: https://patch.msgid.link/20260209142048.1503791-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7a875c0 commit 2d6d260

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/usb/image/mdc800.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t l
707707
if (signal_pending (current))
708708
{
709709
mutex_unlock(&mdc800->io_lock);
710-
return -EINTR;
710+
return len == left ? -EINTR : len-left;
711711
}
712712

713713
sts=left > (mdc800->out_count-mdc800->out_ptr)?mdc800->out_count-mdc800->out_ptr:left;

0 commit comments

Comments
 (0)