summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2018-09-05 12:07:03 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-20 12:48:39 +0200
commit81e0403b26d94360abd1f6a57311337973bc82cd (patch)
tree005180f44bc8ead9578b88cbc17cc2d066189e04 /drivers/usb/core
parent7a68d9fb851012829c29e770621905529bd9490b (diff)
downloadblackbird-op-linux-81e0403b26d94360abd1f6a57311337973bc82cd.tar.gz
blackbird-op-linux-81e0403b26d94360abd1f6a57311337973bc82cd.zip
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 <oneukum@suse.com> Fixes: 0cb54a3e47cb ("USB: debugging code shouldn't alter control flow") Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/devio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 263dd2f309fb..244417d0dfd1 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1697,6 +1697,11 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
u |= URB_NO_INTERRUPT;
as->urb->transfer_flags = u;
+ if (!allow_short && uurb->flags & USBDEVFS_URB_SHORT_NOT_OK)
+ dev_warn(&ps->dev->dev, "Requested nonsensical USBDEVFS_URB_SHORT_NOT_OK.\n");
+ if (!allow_zero && uurb->flags & USBDEVFS_URB_ZERO_PACKET)
+ dev_warn(&ps->dev->dev, "Requested nonsensical USBDEVFS_URB_ZERO_PACKET.\n");
+
as->urb->transfer_buffer_length = uurb->buffer_length;
as->urb->setup_packet = (unsigned char *)dr;
dr = NULL;
OpenPOWER on IntegriCloud