Skip to content

Commit

Permalink
USB: usb-storage: fix initializations of urb fields
Browse files Browse the repository at this point in the history
Commit 0ede76f, "USB: remove uses of
URB_NO_SETUP_DMA_MAP" introduced a regression by inadvertantly removing
initialization of the transfer flags.  This caused initialization
failures in the ums-karma driver.  Fix the regression by zeroing it.

While at it, as Alan Stern points out, the initializers for
actual_length and status are handled by the core and error_count
only matters for isochronous urbs, so they don't need to be set here.
Remove them.

Signed-off-by: Bob Copeland <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
bcopeland authored and gregkh committed Jul 26, 2010
1 parent c30c791 commit c222fb2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/storage/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout)

/* fill the common fields in the URB */
us->current_urb->context = &urb_done;
us->current_urb->actual_length = 0;
us->current_urb->error_count = 0;
us->current_urb->status = 0;
us->current_urb->transfer_flags = 0;

/* we assume that if transfer_buffer isn't us->iobuf then it
* hasn't been mapped for DMA. Yes, this is clunky, but it's
Expand Down

0 comments on commit c222fb2

Please sign in to comment.