Skip to contentSkip to conversation

net: kalmia: clean up bind error path

PATCH In review Johan Hovold 5 participants 7 messages Mar 7, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 drivers/net/usb/kalmia.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/usb/kalmia.c +1 -5
index 1ec523b0e932..bd2ba3659028 100644
@@ -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);
 
#1 lore raw

PATCH 2/2 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.

---
 drivers/net/usb/cdc_eem.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/usb/cdc_eem.c +1 -4
index f7180f8db39e..61ea4eaace5d 100644
@@ -83,11 +83,8 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
 	int status = 0;
 
 	status = usbnet_get_endpoints(dev, intf);
-	if (status < 0) {
-		usb_set_intfdata(intf, NULL);
-		usb_driver_release_interface(driver_of(intf), intf);
+	if (status < 0)
 		return status;
-	}
 
 	/* no jumbogram (16K) support for now */
 
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH net-next 2/2] net: cdc_eem: clean up bind error path

Am Mittwoch, den 07.03.2018, 10:46 +0100 schrieb Johan Hovold:

Quoted 10 lines

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.

Quoted 11 lines
---
 drivers/net/usb/cdc_eem.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/usb/cdc_eem.c +0 -0
index f7180f8db39e..61ea4eaace5d 100644
@@ -83,11 +83,8 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
 	int status = 0;
 

drivers/net/usb/cdc_eem.c static int eem_bind(struct usbnet *dev, struct usb_interface *intf) · line 90

Quoted 10 lines
drivers/net/usb/cdc_eem.c +1 -4
 	status = usbnet_get_endpoints(dev, intf);
-	if (status < 0) {
-		usb_set_intfdata(intf, NULL);
-		usb_driver_release_interface(driver_of(intf), intf);
+	if (status < 0)
 		return status;
-	}
 
 	/* no jumbogram (16K) support for now */
 

---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Reviewed-by on v1 1/2
#5 lore raw
In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

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.

Reviewed-by Greg Kroah-Hartman on v1 2/2
#3 lore raw

Re: [PATCH net-next 2/2] net: cdc_eem: clean up bind error path

In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

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.

maintainer
#6 lore raw
In reply to Johan Hovold

From: Johan Hovold <[email protected]>
Date: Wed, 7 Mar 2018 10:46:57 +0100

Quoted 10 lines

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.

Applied.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#4 lore raw

Re: [PATCH net-next 2/2] net: cdc_eem: clean up bind error path

In reply to Johan Hovold

From: Johan Hovold <[email protected]>
Date: Wed, 7 Mar 2018 10:46:58 +0100

Quoted 10 lines

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.

Applied.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html