From: Johan Hovold <johan@kernel.org> To: "David S. Miller" <davem@davemloft.net>, Oliver Neukum <oliver@neukum.org> Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, Johan Hovold <johan@kernel.org> Subject: [PATCH net-next 2/2] net: cdc_eem: clean up bind error path Date: Wed, 7 Mar 2018 10:46:58 +0100 [thread overview] Message-ID: <20180307094658.9008-2-johan@kernel.org> (raw) In-Reply-To: <20180307094658.9008-1-johan@kernel.org> 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> --- 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
WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org> To: "David S. Miller" <davem@davemloft.net>, Oliver Neukum <oliver@neukum.org> Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, Johan Hovold <johan@kernel.org> Subject: [net-next,2/2] net: cdc_eem: clean up bind error path Date: Wed, 7 Mar 2018 10:46:58 +0100 [thread overview] Message-ID: <20180307094658.9008-2-johan@kernel.org> (raw) 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> --- 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 */
next prev parent reply other threads:[~2018-03-07 9:47 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-03-07 9:46 [PATCH net-next 1/2] net: kalmia: clean up bind error path Johan Hovold 2018-03-07 9:46 ` [net-next,1/2] " Johan Hovold 2018-03-07 9:46 ` Johan Hovold [this message] 2018-03-07 9:46 ` [net-next,2/2] net: cdc_eem: " Johan Hovold 2018-03-07 10:30 ` [PATCH net-next 2/2] " Oliver Neukum 2018-03-07 10:30 ` [net-next,2/2] " Oliver Neukum 2018-03-07 14:56 ` [PATCH net-next 2/2] " Greg KH 2018-03-07 14:56 ` [net-next,2/2] " Greg KH 2018-03-07 20:39 ` [PATCH net-next 2/2] " David Miller 2018-03-07 20:39 ` [net-next,2/2] " David Miller 2018-03-07 14:56 ` [PATCH net-next 1/2] net: kalmia: " Greg KH 2018-03-07 14:56 ` [net-next,1/2] " Greg Kroah-Hartman 2018-03-07 20:39 ` [PATCH net-next 1/2] " David Miller 2018-03-07 20:39 ` [net-next,1/2] " David Miller
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20180307094658.9008-2-johan@kernel.org \ --to=johan@kernel.org \ --cc=davem@davemloft.net \ --cc=linux-usb@vger.kernel.org \ --cc=netdev@vger.kernel.org \ --cc=oliver@neukum.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.