Patch "net: nfc: nci: Change the NCI close sequence" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: nfc: nci: Change the NCI close sequence

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-nfc-nci-change-the-nci-close-sequence.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4ba29536100d2c098bb89cb061a391e417e35f62
Author: Bongsu Jeon <bongsu.jeon@xxxxxxxxxxx>
Date:   Thu Dec 31 11:59:26 2020 +0900

    net: nfc: nci: Change the NCI close sequence
    
    [ Upstream commit f011539e723c737b74876ac47345e40270a3c384 ]
    
    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@xxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 5e55cb6c087a2..4d3ab0f44c9f4 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -568,11 +568,11 @@ static int nci_close_device(struct nci_dev *ndev)
 
 	clear_bit(NCI_INIT, &ndev->flags);
 
-	del_timer_sync(&ndev->cmd_timer);
-
 	/* Flush cmd wq */
 	flush_workqueue(ndev->cmd_wq);
 
+	del_timer_sync(&ndev->cmd_timer);
+
 	/* Clear flags */
 	ndev->flags = 0;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux