Skip to content

Commit

Permalink
[PATCH] USB: gadget zero poisons OUT buffers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Apr 14, 2006
1 parent 9841633 commit 35fcca4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/usb/gadget/zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 35fcca4

Please sign in to comment.