USB: handle zero-length usbfs submissions correctly
commitdcf40b739ed328a82ef6620c7b505a8209c0f009
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 29 Jun 2009 15:04:54 +0000 (29 11:04 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 30 Jul 2009 21:39:13 +0000 (30 14:39 -0700)
treefa8c2623fbe15490983224880adcf1f06a4d6fb6
parent15362af40d0f6708e8a88f58651d122f973ba1d0
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