X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fdrivers%2Fusb%2Fstorage%2Ftransport.c;fp=kernel%2Fdrivers%2Fusb%2Fstorage%2Ftransport.c;h=02f86dd1a3400b3a9cf4551e4a59e817608c2f8b;hb=52f993b8e89487ec9ee15a7fb4979e0f09a45b27;hp=5e67f63b2e462ffc68b5acc1a9f8557828e44489;hpb=c189ccac5702322ed843fe17057035b7222a59b6;p=kvmfornfv.git diff --git a/kernel/drivers/usb/storage/transport.c b/kernel/drivers/usb/storage/transport.c index 5e67f63b2..02f86dd1a 100644 --- a/kernel/drivers/usb/storage/transport.c +++ b/kernel/drivers/usb/storage/transport.c @@ -919,10 +919,15 @@ int usb_stor_CB_transport(struct scsi_cmnd *srb, struct us_data *us) /* COMMAND STAGE */ /* let's send the command via the control pipe */ + /* + * Command is sometime (f.e. after scsi_eh_prep_cmnd) on the stack. + * Stack may be vmallocated. So no DMA for us. Make a copy. + */ + memcpy(us->iobuf, srb->cmnd, srb->cmd_len); result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, US_CBI_ADSC, USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, - us->ifnum, srb->cmnd, srb->cmd_len); + us->ifnum, us->iobuf, srb->cmd_len); /* check the return code for the command */ usb_stor_dbg(us, "Call to usb_stor_ctrl_transfer() returned %d\n",