[RFC]cdc-wdm: race between work queue and pre_reset

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

 



>From 7cccf82cf2c34f8e5b3a60100a1e35108c52bfba Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@xxxxxxx>
Date: Fri, 16 Jan 2015 14:58:23 +0100
Subject: [PATCH] cdc-wdm: race between work queue and pre_reset

pre_reset() must cease IO so the work needs to check
the flag.

Signed-off-by: Oliver Neukum <oneukum@xxxxxxx>
---
 drivers/usb/class/cdc-wdm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 6647f37..5ff7018 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -730,7 +730,9 @@ static void wdm_rxwork(struct work_struct *work)
 	int responding;
 
 	spin_lock_irqsave(&desc->iuspin, flags);
-	if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
+	if (test_bit(WDM_DISCONNECTING, &desc->flags) ||
+	    test_bit(WDM_RESETTING, &desc->flags)
+	) {
 		spin_unlock_irqrestore(&desc->iuspin, flags);
 	} else {
 		responding = test_and_set_bit(WDM_RESPONDING, &desc->flags);
-- 
1.8.4.5



--
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