Commit e0423dee authored by Gerd Hoffmann's avatar Gerd Hoffmann Committed by Greg Kroah-Hartman

USB: uas: fix gcc warning

Streamline control flow so it is easier for gcc to follow which paths
can be taken and which can't.

Fixes "warning: 'cmdinfo' may be used uninitialized in this function"
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1994ff40
...@@ -249,16 +249,18 @@ static void uas_stat_cmplt(struct urb *urb) ...@@ -249,16 +249,18 @@ static void uas_stat_cmplt(struct urb *urb)
cmnd = devinfo->cmnd; cmnd = devinfo->cmnd;
else else
cmnd = scsi_host_find_tag(shost, tag - 1); cmnd = scsi_host_find_tag(shost, tag - 1);
if (!cmnd) { if (!cmnd) {
if (iu->iu_id != IU_ID_RESPONSE) { if (iu->iu_id == IU_ID_RESPONSE) {
/* store results for uas_eh_task_mgmt() */
memcpy(&devinfo->response, iu, sizeof(devinfo->response));
}
usb_free_urb(urb); usb_free_urb(urb);
spin_unlock_irqrestore(&devinfo->lock, flags); spin_unlock_irqrestore(&devinfo->lock, flags);
return; return;
} }
} else {
cmdinfo = (void *)&cmnd->SCp;
}
cmdinfo = (void *)&cmnd->SCp;
switch (iu->iu_id) { switch (iu->iu_id) {
case IU_ID_STATUS: case IU_ID_STATUS:
if (devinfo->cmnd == cmnd) if (devinfo->cmnd == cmnd)
...@@ -292,10 +294,6 @@ static void uas_stat_cmplt(struct urb *urb) ...@@ -292,10 +294,6 @@ static void uas_stat_cmplt(struct urb *urb)
case IU_ID_WRITE_READY: case IU_ID_WRITE_READY:
uas_xfer_data(urb, cmnd, SUBMIT_DATA_OUT_URB); uas_xfer_data(urb, cmnd, SUBMIT_DATA_OUT_URB);
break; break;
case IU_ID_RESPONSE:
/* store results for uas_eh_task_mgmt() */
memcpy(&devinfo->response, iu, sizeof(devinfo->response));
break;
default: default:
scmd_printk(KERN_ERR, cmnd, scmd_printk(KERN_ERR, cmnd,
"Bogus IU (%d) received on status pipe\n", iu->iu_id); "Bogus IU (%d) received on status pipe\n", iu->iu_id);
......
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