summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-04-02 10:19:43 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-04-14 11:12:24 -0700
commit35fcca442aca1a8d927b697e7e15d3f655958bd7 (patch)
treec1ca1ef82f8a23ba60023452c02ea595093c81a1 /drivers/usb
parent984163338a24198863116ccf3e7762fd1fc3c663 (diff)
downloadop-kernel-dev-35fcca442aca1a8d927b697e7e15d3f655958bd7.zip
op-kernel-dev-35fcca442aca1a8d927b697e7e15d3f655958bd7.tar.gz
[PATCH] USB: gadget zero poisons OUT buffers
Fill OUT buffers with 0x55 before RX, so that controller driver bugs that mangle data can be more readily detected during testing. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/zero.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 51424f6..68e3d8f 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -572,9 +572,10 @@ static void source_sink_complete (struct usb_ep *ep, struct usb_request *req)
switch (status) {
case 0: /* normal completion? */
- if (ep == dev->out_ep)
+ if (ep == dev->out_ep) {
check_read_data (dev, ep, req);
- else
+ memset (req->buf, 0x55, req->length);
+ } else
reinit_write_data (dev, ep, req);
break;
@@ -626,6 +627,8 @@ source_sink_start_ep (struct usb_ep *ep, gfp_t gfp_flags)
if (strcmp (ep->name, EP_IN_NAME) == 0)
reinit_write_data (ep->driver_data, ep, req);
+ else
+ memset (req->buf, 0x55, req->length);
status = usb_ep_queue (ep, req, gfp_flags);
if (status) {
OpenPOWER on IntegriCloud