Commit d07cc72d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: fix up fake usb_interface structure in hiddev

This fixes a oops in the current kernel tree.
parent 3dcad070
...@@ -53,7 +53,6 @@ struct hiddev { ...@@ -53,7 +53,6 @@ struct hiddev {
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;
struct usb_interface intf;
}; };
struct hiddev_list { struct hiddev_list {
...@@ -234,7 +233,7 @@ static int hiddev_fasync(int fd, struct file *file, int on) ...@@ -234,7 +233,7 @@ 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)
{ {
usb_deregister_dev(&hiddev->intf, &hiddev_class); usb_deregister_dev(hiddev->hid->intf, &hiddev_class);
hiddev_table[hiddev->minor] = NULL; hiddev_table[hiddev->minor] = NULL;
kfree(hiddev); kfree(hiddev);
} }
...@@ -775,7 +774,7 @@ int hiddev_connect(struct hid_device *hid) ...@@ -775,7 +774,7 @@ int hiddev_connect(struct hid_device *hid)
return -1; return -1;
memset(hiddev, 0, sizeof(struct hiddev)); memset(hiddev, 0, sizeof(struct hiddev));
retval = usb_register_dev(&hiddev->intf, &hiddev_class); retval = usb_register_dev(hid->intf, &hiddev_class);
if (retval) { if (retval) {
err("Not able to get a minor for this device."); err("Not able to get a minor for this device.");
kfree(hiddev); kfree(hiddev);
...@@ -784,13 +783,13 @@ int hiddev_connect(struct hid_device *hid) ...@@ -784,13 +783,13 @@ int hiddev_connect(struct hid_device *hid)
init_waitqueue_head(&hiddev->wait); init_waitqueue_head(&hiddev->wait);
hiddev->minor = hiddev->intf.minor; hiddev->minor = hid->intf->minor;
hiddev_table[hiddev->intf.minor - HIDDEV_MINOR_BASE] = hiddev; hiddev_table[hid->intf->minor - HIDDEV_MINOR_BASE] = hiddev;
hiddev->hid = hid; hiddev->hid = hid;
hiddev->exist = 1; hiddev->exist = 1;
hid->minor = hiddev->intf.minor; hid->minor = hid->intf->minor;
hid->hiddev = hiddev; hid->hiddev = hiddev;
return 0; return 0;
......
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