Re: [syzbot] [net?] [nfc?] INFO: task hung in nfc_targets_found

From: Edward Adam Davis
Date: Sun Jan 14 2024 - 02:44:10 EST


please test task hung in nfc_targets_found

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git acc657692aed

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