]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:16 +0000 (11:40 +0200)
commit619b9db543da2f9fe693baf2fc90b181ecd72959
treec9adc132855cb3d20227150bc78fcd4336bbde10
parent686247278b22ed3b74189052b4c7af1621d145ed
nfc: fix error handling of nfc_proto_register()

commit 0911ab31896f0e908540746414a77dd63912748d upstream.

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: 58a78a3521b6 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/nfc/af_nfc.c