USB: handle zero-length usbfs submissions correctly
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 29 Jun 2009 15:04:54 +0000 (11:04 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 30 Jul 2009 23:06:03 +0000 (16:06 -0700)
commit0a9b8d3bae0dfe231e244e3b1952886248bd683e
treea4932d8b867a0c600ef18d2f494f8be51779844e
parentd84b737af8969ff13cf2f1d2942ce50a6d9aa554
USB: handle zero-length usbfs submissions correctly

commit 9180135bc80ab11199d482b6111e23f74d65af4a upstream.

This patch (as1262) fixes a bug in usbfs: It refuses to accept
zero-length transfers, and it insists that the buffer pointer be valid
even if there is no data being transferred.

The patch also consolidates a bunch of repetitive access_ok() checks
into a single check, which incidentally fixes the lack of such a check
for Isochronous URBs.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c