mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-16 22:51:32 +00:00
uas: Check against unexpected completions
The status urb should not complete before the command has been submitted, nor should we get a second status urb for the same tag after a IU_ID_STATUS. Data urbs should not complete before the command has been submitted, but may complete after the IU_ID_STATUS. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5e61aede47
commit
d89da03ace
@ -371,6 +371,12 @@ static void uas_stat_cmplt(struct urb *urb)
|
|||||||
|
|
||||||
cmnd = devinfo->cmnd[idx];
|
cmnd = devinfo->cmnd[idx];
|
||||||
cmdinfo = (void *)&cmnd->SCp;
|
cmdinfo = (void *)&cmnd->SCp;
|
||||||
|
|
||||||
|
if (!(cmdinfo->state & COMMAND_INFLIGHT)) {
|
||||||
|
scmd_printk(KERN_ERR, cmnd, "unexpected status cmplt\n");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
switch (iu->iu_id) {
|
switch (iu->iu_id) {
|
||||||
case IU_ID_STATUS:
|
case IU_ID_STATUS:
|
||||||
if (urb->actual_length < 16)
|
if (urb->actual_length < 16)
|
||||||
@ -436,6 +442,12 @@ static void uas_data_cmplt(struct urb *urb)
|
|||||||
if (devinfo->resetting)
|
if (devinfo->resetting)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
/* Data urbs should not complete before the cmd urb is submitted */
|
||||||
|
if (cmdinfo->state & SUBMIT_CMD_URB) {
|
||||||
|
scmd_printk(KERN_ERR, cmnd, "unexpected data cmplt\n");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (urb->status) {
|
if (urb->status) {
|
||||||
if (urb->status != -ECONNRESET) {
|
if (urb->status != -ECONNRESET) {
|
||||||
uas_log_cmd_state(cmnd, __func__);
|
uas_log_cmd_state(cmnd, __func__);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user