Skip to content

Commit

Permalink
net: kalmia: clean up bind error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and David S. Miller committed Mar 7, 2018
1 parent bcde6b7 commit 4f06717
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/net/usb/kalmia.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,8 @@ kalmia_bind(struct usbnet *dev, struct usb_interface *intf)
dev->rx_urb_size = dev->hard_mtu * 10; // Found as optimal after testing

status = kalmia_init_and_get_ethernet_addr(dev, ethernet_addr);

if (status) {
usb_set_intfdata(intf, NULL);
usb_driver_release_interface(driver_of(intf), intf);
if (status)
return status;
}

memcpy(dev->net->dev_addr, ethernet_addr, ETH_ALEN);

Expand Down

0 comments on commit 4f06717

Please sign in to comment.