Commit 2148247
xhci: Prevent futile URB re-submissions due to incorrect return value.
commit 243a1dd upstream.
The -ENODEV return value from xhci_check_args() is incorrectly changed
to -EINVAL in a couple places before propagated further.
xhci_check_args() returns 4 types of value, -ENODEV, -EINVAL, 1 and 0.
xhci_urb_enqueue and xhci_check_streams_endpoint return -EINVAL if
the return value of xhci_check_args <= 0.
This causes problems for example r8152_submit_rx, calling usb_submit_urb
in drivers/net/usb/r8152.c.
r8152_submit_rx will never get -ENODEV after submiting an urb when xHC
is halted because xhci_urb_enqueue returns -EINVAL in the very beginning.
[commit message and header edit -Mathias]
Fixes: 203a866 ("xhci: Avoid NULL pointer deref when host dies.")
Cc: stable@vger.kernel.org
Signed-off-by: Hongyu Xie <xiehongyu1@kylinos.cn>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220215123320.1253947-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 0b0a229 commit 2148247
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1487 | 1487 | | |
1488 | 1488 | | |
1489 | 1489 | | |
1490 | | - | |
1491 | | - | |
| 1490 | + | |
1492 | 1491 | | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1493 | 1496 | | |
1494 | 1497 | | |
1495 | 1498 | | |
| |||
3289 | 3292 | | |
3290 | 3293 | | |
3291 | 3294 | | |
3292 | | - | |
| 3295 | + | |
3293 | 3296 | | |
3294 | 3297 | | |
3295 | 3298 | | |
| |||
0 commit comments