Commit b6823c51 authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman

uas: Remove cmnd reference from the cmd urb

It is not strictly necessary for the cmd urb to have a reference to the
cmnd, and without this reference it becomes easier to drop all references to
a cmnd on an abort.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 43cd99cb
...@@ -428,12 +428,9 @@ static void uas_data_cmplt(struct urb *urb) ...@@ -428,12 +428,9 @@ static void uas_data_cmplt(struct urb *urb)
static void uas_cmd_cmplt(struct urb *urb) static void uas_cmd_cmplt(struct urb *urb)
{ {
struct scsi_cmnd *cmnd = urb->context; if (urb->status)
dev_err(&urb->dev->dev, "cmd cmplt err %d\n", urb->status);
if (urb->status) {
uas_log_cmd_state(cmnd, __func__);
scmd_printk(KERN_ERR, cmnd, "cmd cmplt err %d\n", urb->status);
}
usb_free_urb(urb); usb_free_urb(urb);
} }
...@@ -511,7 +508,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp, ...@@ -511,7 +508,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp,
memcpy(iu->cdb, cmnd->cmnd, cmnd->cmd_len); memcpy(iu->cdb, cmnd->cmnd, cmnd->cmd_len);
usb_fill_bulk_urb(urb, udev, devinfo->cmd_pipe, iu, sizeof(*iu) + len, usb_fill_bulk_urb(urb, udev, devinfo->cmd_pipe, iu, sizeof(*iu) + len,
uas_cmd_cmplt, cmnd); uas_cmd_cmplt, NULL);
urb->transfer_flags |= URB_FREE_BUFFER; urb->transfer_flags |= URB_FREE_BUFFER;
out: out:
return urb; return urb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment