summaryrefslogtreecommitdiff
path: root/net/nfc/af_nfc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/nfc/af_nfc.c')
-rw-r--r--net/nfc/af_nfc.c3
1 files changed, 3 insertions, 0 deletions
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);