summaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2013-12-23 14:15:13 -0800
committerSamuel Ortiz <sameo@linux.intel.com>2014-01-05 23:20:15 +0100
commitfa9be5f009e8cfc695a2cd71617fc620ab5c1c18 (patch)
treebad68b5f41934abd1173136929ff3ee6d4f57d5b /net/nfc
parentc36aeba8c072d20a08e8546483494ab0f6458963 (diff)
downloadblackbird-op-linux-fa9be5f009e8cfc695a2cd71617fc620ab5c1c18.tar.gz
blackbird-op-linux-fa9be5f009e8cfc695a2cd71617fc620ab5c1c18.zip
NFC: NCI: Cancel cmd_timer in nci_close_device()
nci_close_device() sends nci reset command to the device. If there is no response for this command, nci request timeout occurs first and then cmd timeout happens. Because command timer has started after sending the command. We are immediately flushing command workqueue after nci timeout. Later we will try to schedule cmd_work in command timer which leads to a crash. Cancel cmd_timer before flushing the workqueue to fix the problem. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index f0e955e3a385..0a2ee83c3bd3 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -361,6 +361,8 @@ static int nci_close_device(struct nci_dev *ndev)
msecs_to_jiffies(NCI_RESET_TIMEOUT));
clear_bit(NCI_INIT, &ndev->flags);
+ del_timer_sync(&ndev->cmd_timer);
+
/* Flush cmd wq */
flush_workqueue(ndev->cmd_wq);
OpenPOWER on IntegriCloud