Commit ec0b47c5 authored by Michal Sojka's avatar Michal Sojka Committed by Greg Kroah-Hartman

[PATCH] USB: fixes for usb-skeleton.c

I've found minor errors in usb-skeleton.c. First, there is no valid
value of interface->minor in assignment to dev->minor. Second, when
calling usb_deregister_dev the interface->minor must be valid or else
minor isn't deregistered.
parent 0f138bbf
...@@ -526,7 +526,6 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i ...@@ -526,7 +526,6 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
init_MUTEX (&dev->sem); init_MUTEX (&dev->sem);
dev->udev = udev; dev->udev = udev;
dev->interface = interface; dev->interface = interface;
dev->minor = interface->minor;
/* set up the endpoint information */ /* set up the endpoint information */
/* check out the endpoints */ /* check out the endpoints */
...@@ -606,6 +605,7 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i ...@@ -606,6 +605,7 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
goto error; goto error;
} }
dev->minor = interface->minor;
/* let the user know what node this device is now attached to */ /* let the user know what node this device is now attached to */
info ("USB Skeleton device now attached to USBSkel-%d", dev->minor); info ("USB Skeleton device now attached to USBSkel-%d", dev->minor);
...@@ -641,9 +641,6 @@ static void skel_disconnect(struct usb_interface *interface) ...@@ -641,9 +641,6 @@ static void skel_disconnect(struct usb_interface *interface)
down (&dev->sem); down (&dev->sem);
/* disable open() */
interface->minor = -1;
minor = dev->minor; minor = dev->minor;
/* give back our minor */ /* give back our minor */
......
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