From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com ([209.85.215.65]:43421 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075AbeCGJrU (ORCPT ); Wed, 7 Mar 2018 04:47:20 -0500 From: Johan Hovold To: "David S. Miller" , Oliver Neukum Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, Johan Hovold Subject: [PATCH net-next 2/2] net: cdc_eem: clean up bind error path Date: Wed, 7 Mar 2018 10:46:58 +0100 Message-Id: <20180307094658.9008-2-johan@kernel.org> In-Reply-To: <20180307094658.9008-1-johan@kernel.org> References: <20180307094658.9008-1-johan@kernel.org> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- drivers/net/usb/cdc_eem.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index f7180f8db39e..61ea4eaace5d 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c @@ -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 */ -- 2.16.2