Skip to content

Commit 81e0403

Browse files
oneukumgregkh
authored andcommitted
USB: usbdevfs: restore warning for nonsensical flags
If we filter flags before they reach the core we need to generate our own warnings. Signed-off-by: Oliver Neukum <[email protected]> Fixes: 0cb54a3 ("USB: debugging code shouldn't alter control flow") Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7a68d9f commit 81e0403

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/usb/core/devio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,11 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
16971697
u |= URB_NO_INTERRUPT;
16981698
as->urb->transfer_flags = u;
16991699

1700+
if (!allow_short && uurb->flags & USBDEVFS_URB_SHORT_NOT_OK)
1701+
dev_warn(&ps->dev->dev, "Requested nonsensical USBDEVFS_URB_SHORT_NOT_OK.\n");
1702+
if (!allow_zero && uurb->flags & USBDEVFS_URB_ZERO_PACKET)
1703+
dev_warn(&ps->dev->dev, "Requested nonsensical USBDEVFS_URB_ZERO_PACKET.\n");
1704+
17001705
as->urb->transfer_buffer_length = uurb->buffer_length;
17011706
as->urb->setup_packet = (unsigned char *)dr;
17021707
dr = NULL;

0 commit comments

Comments
 (0)