Skip to contentSkip to conversation

net: cxgb3: add missed destroy_workqueue in nci_register_device

PATCH In review Wang Hai 1 participant 2 messages Jul 17, 2020

Subsystems (3)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 net: cxgb3: add missed destroy_workqueue in nci_register_device

When nfc_register_device fails in nci_register_device, destroy_workqueue() shouled be called to destroy ndev->tx_wq.

Fixes 3c1c0f5dc80b ("NFC: NCI: Fix nci_register_device init sequence")
---
 net/nfc/nci/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/nfc/nci/core.c +4 -1
index 7cd524884304..78ea8c94dcba 100644
@@ -1228,10 +1228,13 @@ int nci_register_device(struct nci_dev *ndev)
 
 	rc = nfc_register_device(ndev->nfc_dev);
 	if (rc)
-		goto destroy_rx_wq_exit;
+		goto destroy_tx_wq_exit;
 
 	goto exit;
 
+destroy_tx_wq_exit:
+	destroy_workqueue(ndev->tx_wq);
+
 destroy_rx_wq_exit:
 	destroy_workqueue(ndev->rx_wq);
 
Signature · 1 line
2.17.1
#1 lore raw

subject msg was wrong. "net: cxgb3:" should be "nfc: nci:".  v2 patch has been sent.

("[PATCH v2] nfc: nci: add missed destroy_workqueue in nci_register_device")

Quoted 29 lines · Wang Hai

When nfc_register_device fails in nci_register_device, destroy_workqueue() shouled be called to destroy ndev->tx_wq.

Fixes 3c1c0f5dc80b ("NFC: NCI: Fix nci_register_device init sequence")
---
  net/nfc/nci/core.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
net/nfc/nci/core.c +4 -1
index 7cd524884304..78ea8c94dcba 100644
@@ -1228,10 +1228,13 @@ int nci_register_device(struct nci_dev *ndev)
 
  	rc = nfc_register_device(ndev->nfc_dev);
  	if (rc)
-		goto destroy_rx_wq_exit;
+		goto destroy_tx_wq_exit;
 
  	goto exit;
 
+destroy_tx_wq_exit:
+	destroy_workqueue(ndev->tx_wq);
+
  destroy_rx_wq_exit:
  	destroy_workqueue(ndev->rx_wq);