Patchwork [net,3/3] net: cdc_ncm: fix error path for single interface probing

login
register
mail settings
Submitter Bjørn Mork
Date Jan. 21, 2013, 3:50 p.m.
Message ID <1358783440-11459-4-git-send-email-bjorn@mork.no>
Download mbox | patch
Permalink /patch/214191/
State Accepted
Delegated to: David Miller
Headers show

Comments

Bjørn Mork - Jan. 21, 2013, 3:50 p.m.
commit bbc8d92 (net: cdc_ncm: add Huawei devices) implemented
support for devices with a single combined control and data
interface. Fix up the error path so that we do not double
release such interfaces in case of probing failures.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 drivers/net/usb/cdc_ncm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Oliver Neukum - Jan. 22, 2013, 8:58 a.m.
On Monday 21 January 2013 16:50:40 Bjørn Mork wrote:
> commit bbc8d92 (net: cdc_ncm: add Huawei devices) implemented
> support for devices with a single combined control and data
> interface. Fix up the error path so that we do not double
> release such interfaces in case of probing failures.

Hi Bjørn,

this should go also into stable. Could you submit?

	Regards
		Oliver

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjørn Mork - Jan. 22, 2013, 10:32 a.m.
Oliver Neukum <oneukum@suse.de> writes:
> On Monday 21 January 2013 16:50:40 Bjørn Mork wrote:
>> commit bbc8d92 (net: cdc_ncm: add Huawei devices) implemented
>> support for devices with a single combined control and data
>> interface. Fix up the error path so that we do not double
>> release such interfaces in case of probing failures.
>
> Hi Bjørn,
>
> this should go also into stable. Could you submit?

Yes, it should.  But AFAIK David prefers to do the stable submissions
for net, including drivers/net/usb.


Bjørn
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 4041159..2c4b41f 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -524,7 +524,8 @@  advance:
 error2:
 	usb_set_intfdata(ctx->control, NULL);
 	usb_set_intfdata(ctx->data, NULL);
-	usb_driver_release_interface(driver, ctx->data);
+	if (ctx->data != ctx->control)
+		usb_driver_release_interface(driver, ctx->data);
 error:
 	cdc_ncm_free((struct cdc_ncm_ctx *)dev->data[0]);
 	dev->data[0] = 0;