* [PATCH net] nfc: fix error handling of nfc_proto_register()
@ 2021-10-13 3:49 Ziyang Xuan
2021-10-13 9:53 ` Krzysztof Kozlowski
2021-10-14 0:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Ziyang Xuan @ 2021-10-13 3:49 UTC (permalink / raw)
To: krzysztof.kozlowski; +Cc: davem, kuba, netdev, linux-kernel
When nfc proto id is using, nfc_proto_register() return -EBUSY error
code, but forgot to unregister proto. Fix it by adding proto_unregister()
in the error handling case.
Fixes: c7fe3b52c128 ("NFC: add NFC socket family")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
---
net/nfc/af_nfc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/nfc/af_nfc.c b/net/nfc/af_nfc.c
index 6024fad905ff..dda323e0a473 100644
--- a/net/nfc/af_nfc.c
+++ b/net/nfc/af_nfc.c
@@ -60,6 +60,9 @@ int nfc_proto_register(const struct nfc_protocol *nfc_proto)
proto_tab[nfc_proto->id] = nfc_proto;
write_unlock(&proto_tab_lock);
+ if (rc)
+ proto_unregister(nfc_proto->proto);
+
return rc;
}
EXPORT_SYMBOL(nfc_proto_register);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] nfc: fix error handling of nfc_proto_register()
2021-10-13 3:49 [PATCH net] nfc: fix error handling of nfc_proto_register() Ziyang Xuan
@ 2021-10-13 9:53 ` Krzysztof Kozlowski
2021-10-14 0:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-10-13 9:53 UTC (permalink / raw)
To: Ziyang Xuan; +Cc: davem, kuba, netdev, linux-kernel
On 13/10/2021 05:49, Ziyang Xuan wrote:
> When nfc proto id is using, nfc_proto_register() return -EBUSY error
> code, but forgot to unregister proto. Fix it by adding proto_unregister()
> in the error handling case.
>
> Fixes: c7fe3b52c128 ("NFC: add NFC socket family")
> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
> ---
> net/nfc/af_nfc.c | 3 +++
> 1 file changed, 3 insertions(+)
>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] nfc: fix error handling of nfc_proto_register()
2021-10-13 3:49 [PATCH net] nfc: fix error handling of nfc_proto_register() Ziyang Xuan
2021-10-13 9:53 ` Krzysztof Kozlowski
@ 2021-10-14 0:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-14 0:40 UTC (permalink / raw)
To: Ziyang Xuan; +Cc: krzysztof.kozlowski, davem, kuba, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 13 Oct 2021 11:49:32 +0800 you wrote:
> When nfc proto id is using, nfc_proto_register() return -EBUSY error
> code, but forgot to unregister proto. Fix it by adding proto_unregister()
> in the error handling case.
>
> Fixes: c7fe3b52c128 ("NFC: add NFC socket family")
> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
>
> [...]
Here is the summary with links:
- [net] nfc: fix error handling of nfc_proto_register()
https://git.kernel.org/netdev/net/c/0911ab31896f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-14 0:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 3:49 [PATCH net] nfc: fix error handling of nfc_proto_register() Ziyang Xuan
2021-10-13 9:53 ` Krzysztof Kozlowski
2021-10-14 0:40 ` patchwork-bot+netdevbpf
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.