USB: UAS: fix disconnect by unplugging a hub
commit56ad2cab0845ce404305d91f9a9bfea47b9136dd
authorOliver Neukum <oneukum@suse.com>
Wed, 16 Sep 2020 09:40:25 +0000 (16 11:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 10:40:43 +0000 (23 12:40 +0200)
tree78b821e5d226f8438ef3b543906c32e0fbb0c17f
parentd8c0a033d9ce3566e2bab4ddc91545a4f832f0ce
USB: UAS: fix disconnect by unplugging a hub

commit 325b008723b2dd31de020e85ab9d2e9aa4637d35 upstream.

The SCSI layer can go into an ugly loop if you ignore that a device is
gone. You need to report an error in the command rather than in the
return value of the queue method.

We need to specifically check for ENODEV. The issue goes back to the
introduction of the driver.

Fixes: 115bb1ffa54c3 ("USB: Add UAS driver")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200916094026.30085-2-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/storage/uas.c