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

net: kalmia: 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>
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
4f06717f bcde6b72

+1 -5
+1 -5
drivers/net/usb/kalmia.c
··· 150 150 dev->rx_urb_size = dev->hard_mtu * 10; // Found as optimal after testing 151 151 152 152 status = kalmia_init_and_get_ethernet_addr(dev, ethernet_addr); 153 - 154 - if (status) { 155 - usb_set_intfdata(intf, NULL); 156 - usb_driver_release_interface(driver_of(intf), intf); 153 + if (status) 157 154 return status; 158 - } 159 155 160 156 memcpy(dev->net->dev_addr, ethernet_addr, ETH_ALEN); 161 157