Skip to content

Commit

Permalink
net: cdc_ncm: fix error path for single interface probing
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bjørn Mork authored and David S. Miller committed Jan 21, 2013
1 parent 328d7b8 commit 6b4ef60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,8 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
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;
Expand Down

0 comments on commit 6b4ef60

Please sign in to comment.