Message ID | 20210318155749.22597-1-johan@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | c79a707072fe3fea0e3c92edee6ca85c1e53c29f |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: cdc-phonet: fix data-interface release on probe failure | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | fail | 1 blamed authors not CCed: remi.denis-courmont@nokia.com; 3 maintainers not CCed: remi.denis-courmont@nokia.com zhengyongjun3@huawei.com gustavoars@kernel.org |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 8 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Thu, 18 Mar 2021 16:57:49 +0100 you wrote: > 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> > > [...] Here is the summary with links: - [net] net: cdc-phonet: fix data-interface release on probe failure https://git.kernel.org/netdev/net/c/c79a707072fe You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 02e6bbb17b15..8d1f69dad603 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -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; }
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> --- drivers/net/usb/cdc-phonet.c | 2 ++ 1 file changed, 2 insertions(+)