diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 6c9592d05120..9a277228a875 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -145,6 +145,8 @@ inline int nci_request(struct nci_dev *ndev, { int rc; + if (test_bit(NCI_UNREG, &ndev->flags)) + return -ENODEV; /* Serialize all requests */ mutex_lock(&ndev->req_lock); /* check the state after obtaing the lock against any races