diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c index 1dac28136e6a..016364890357 100644 --- a/net/nfc/llcp_core.c +++ b/net/nfc/llcp_core.c @@ -1640,11 +1640,14 @@ int nfc_llcp_register_device(struct nfc_dev *ndev) void nfc_llcp_unregister_device(struct nfc_dev *dev) { struct nfc_llcp_local *local = nfc_llcp_remove_local(dev); + struct nfc_llcp_sock *nls; if (local == NULL) { pr_debug("No such device\n"); return; } + nls = container_of(local, struct nfc_llcp_sock, local); + nls->local = NULL; local_cleanup(local);