]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: fix error handling of nfc_proto_register()
authorZiyang Xuan <william.xuanziyang@huawei.com>
Wed, 13 Oct 2021 03:49:32 +0000 (11:49 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 Oct 2021 00:32:38 +0000 (17:32 -0700)
commit59cc317dfdbebb6c4fbee6a3512532f262b8cd23
tree84f7711856e1b7b588da69295d172aa0897cc24b
parent557f964f5aa19d799d39811851889d55a92d8b10
nfc: fix error handling of nfc_proto_register()

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: c3573bfdbb63 ("NFC: add NFC socket family")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20211013034932.2833737-1-william.xuanziyang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/nfc/af_nfc.c