]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Revert "usb: cdc-wdm: close race between read and workqueue"
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Apr 2024 14:33:28 +0000 (16:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Apr 2024 14:33:28 +0000 (16:33 +0200)
This reverts commit 339f83612f3a569b194680768b22bf113c26a29d.

It has been found to cause problems in a number of Chromebook devices,
so revert the change until it can be brought back in a safe way.

Link: https://lore.kernel.org/r/385a3519-b45d-48c5-a6fd-a3fdb6bec92f@chromium.org
Reported-by:: Aleksander Morgado <aleksandermj@chromium.org>
Fixes: 339f83612f3a ("usb: cdc-wdm: close race between read and workqueue")
Cc: stable <stable@kernel.org>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-wdm.c

index c8262e2f291778c785193b4311ab9613d0c18697..c553decb5461078280b5f566a6ccd4035727c4a6 100644 (file)
@@ -485,7 +485,6 @@ out_free_mem:
 static int service_outstanding_interrupt(struct wdm_device *desc)
 {
        int rv = 0;
-       int used;
 
        /* submit read urb only if the device is waiting for it */
        if (!desc->resp_count || !--desc->resp_count)
@@ -500,10 +499,7 @@ static int service_outstanding_interrupt(struct wdm_device *desc)
                goto out;
        }
 
-       used = test_and_set_bit(WDM_RESPONDING, &desc->flags);
-       if (used)
-               goto out;
-
+       set_bit(WDM_RESPONDING, &desc->flags);
        spin_unlock_irq(&desc->iuspin);
        rv = usb_submit_urb(desc->response, GFP_KERNEL);
        spin_lock_irq(&desc->iuspin);