From foo@baz Tue Apr 9 12:12:43 2002 To: Greg KH Date: 26 Apr 2004 11:23:36 -07:00 From: greg@kroah.com Subject: USB: further cleanup of the hiddev driver, fixing another possible oops on disconnect. diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c --- a/drivers/usb/input/hiddev.c Mon Apr 26 11:38:28 2004 +++ b/drivers/usb/input/hiddev.c Mon Apr 26 11:38:28 2004 @@ -49,7 +49,6 @@ struct hiddev { int exist; int open; - int minor; wait_queue_head_t wait; struct hid_device *hid; struct hiddev_list *list; @@ -233,8 +232,8 @@ static struct usb_class_driver hiddev_class; static void hiddev_cleanup(struct hiddev *hiddev) { + hiddev_table[hiddev->hid->minor] = NULL; usb_deregister_dev(hiddev->hid->intf, &hiddev_class); - hiddev_table[hiddev->minor] = NULL; kfree(hiddev); } @@ -783,7 +782,6 @@ init_waitqueue_head(&hiddev->wait); - hiddev->minor = hid->intf->minor; hiddev_table[hid->intf->minor - HIDDEV_MINOR_BASE] = hiddev; hiddev->hid = hid;