mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 23:39:18 +00:00
net: cdc-phonet: fix data-interface release on probe failure
Set the disconnected flag before releasing the data interface in case netdev registration fails to avoid having the disconnect callback try to deregister the never registered netdev (and trigger a WARN_ON()). Fixes: 87cf65601e17 ("USB host CDC Phonet network interface driver") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
84f4aced67
commit
c79a707072
@ -387,6 +387,8 @@ static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *i
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err) {
|
||||
/* Set disconnected flag so that disconnect() returns early. */
|
||||
pnd->disconnected = 1;
|
||||
usb_driver_release_interface(&usbpn_driver, data_intf);
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user