Commit 2436e282 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: further cleanup of the hiddev driver, fixing another possible oops on disconnect.

parent d07cc72d
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
struct hiddev { struct hiddev {
int exist; int exist;
int open; int open;
int minor;
wait_queue_head_t wait; wait_queue_head_t wait;
struct hid_device *hid; struct hid_device *hid;
struct hiddev_list *list; struct hiddev_list *list;
...@@ -233,8 +232,8 @@ static int hiddev_fasync(int fd, struct file *file, int on) ...@@ -233,8 +232,8 @@ static int hiddev_fasync(int fd, struct file *file, int on)
static struct usb_class_driver hiddev_class; static struct usb_class_driver hiddev_class;
static void hiddev_cleanup(struct hiddev *hiddev) static void hiddev_cleanup(struct hiddev *hiddev)
{ {
hiddev_table[hiddev->hid->minor] = NULL;
usb_deregister_dev(hiddev->hid->intf, &hiddev_class); usb_deregister_dev(hiddev->hid->intf, &hiddev_class);
hiddev_table[hiddev->minor] = NULL;
kfree(hiddev); kfree(hiddev);
} }
...@@ -783,7 +782,6 @@ int hiddev_connect(struct hid_device *hid) ...@@ -783,7 +782,6 @@ int hiddev_connect(struct hid_device *hid)
init_waitqueue_head(&hiddev->wait); init_waitqueue_head(&hiddev->wait);
hiddev->minor = hid->intf->minor;
hiddev_table[hid->intf->minor - HIDDEV_MINOR_BASE] = hiddev; hiddev_table[hid->intf->minor - HIDDEV_MINOR_BASE] = hiddev;
hiddev->hid = hid; hiddev->hid = hid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment