Commit:     ed206ec9ab398e1c3756ff0eb9507db1d009e65f
Parent:     7ced46c3ad1dfaaabf9ec6c98cbb0a48e080fb11
Author:     Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 28 08:21:59 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed Nov 28 13:58:33 2007 -0800

    USB: fix usbled disconnect read race #2
    usbled has a race where show methods for attributes in sysfs can
    follow a NULL pointer during disconnect. The correct ordering fixes
    Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
 drivers/usb/misc/usbled.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c
index 49c5c5c..06cb719 100644
--- a/drivers/usb/misc/usbled.c
+++ b/drivers/usb/misc/usbled.c
@@ -144,12 +144,14 @@ static void led_disconnect(struct usb_interface 
        struct usb_led *dev;
        dev = usb_get_intfdata (interface);
-       usb_set_intfdata (interface, NULL);
        device_remove_file(&interface->dev, &dev_attr_blue);
        device_remove_file(&interface->dev, &dev_attr_red);
        device_remove_file(&interface->dev, &dev_attr_green);
+       /* first remove the files, then set the pointer to NULL */
+       usb_set_intfdata (interface, NULL);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to