Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: cdc_eem: clean up bind error path

Drop bogus call to usb_driver_release_interface() from an error path in
the usbnet bind() callback, which is called during interface probe. At
this point the interface is not bound and usb_driver_release_interface()
returns early.

Also remove the bogus call to clear the interface data, which is owned
by the usbnet driver and would not even have been set by the time bind()
is called.

Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Johan Hovold and committed by
David S. Miller
bb5441fc 4f06717f

+1 -4
+1 -4
drivers/net/usb/cdc_eem.c
··· 83 83 int status = 0; 84 84 85 85 status = usbnet_get_endpoints(dev, intf); 86 - if (status < 0) { 87 - usb_set_intfdata(intf, NULL); 88 - usb_driver_release_interface(driver_of(intf), intf); 86 + if (status < 0) 89 87 return status; 90 - } 91 88 92 89 /* no jumbogram (16K) support for now */ 93 90