Skip to content

Commit f011539

Browse files
Bongsu Jeondavem330
authored andcommitted
net: nfc: nci: Change the NCI close sequence
If there is a NCI command in work queue after closing the NCI device at nci_unregister_device, The NCI command timer starts at flush_workqueue function and then NCI command timeout handler would be called 5 second after flushing the NCI command work queue and destroying the queue. At that time, the timeout handler would try to use NCI command work queue that is destroyed already. it will causes the problem. To avoid this abnormal situation, change the sequence to prevent the NCI command timeout handler from being called after destroying the NCI command work queue. Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8dc879a commit f011539

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/nfc/nci/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,11 @@ static int nci_close_device(struct nci_dev *ndev)
579579

580580
clear_bit(NCI_INIT, &ndev->flags);
581581

582-
del_timer_sync(&ndev->cmd_timer);
583-
584582
/* Flush cmd wq */
585583
flush_workqueue(ndev->cmd_wq);
586584

585+
del_timer_sync(&ndev->cmd_timer);
586+
587587
/* Clear flags */
588588
ndev->flags = 0;
589589

0 commit comments

Comments
 (0)