mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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: c7fe3b52c1 ("NFC: add NFC socket family")
Signed-off-by: Ziyang Xuan <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
2731eaac19
commit
69b3a13f0d
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue