[PATCH 13/14] uas: fix race between evaluation and completion in TMF results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First evaluate, then notify the consumer.

Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx>
---
 drivers/usb/storage/uas.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index d2d9244..d789227 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -492,8 +492,6 @@ static void uas_tmf_cmplt(struct urb *urb)
 	int status = urb->status;
 
 	if (status < 0) {
-		devinfo->deathrow = NULL;
-		complete(&devinfo->deathknell);
 		switch (status) {
 		case -ESHUTDOWN:
 		case -ENODEV:
@@ -508,6 +506,8 @@ static void uas_tmf_cmplt(struct urb *urb)
 		default:
 			break;
 		}
+		devinfo->deathrow = NULL;
+		complete(&devinfo->deathknell);
 	}
 
 	/*
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux