From: Wang Hai Date: Fri, 17 Jul 2020 07:10:16 +0000 (+0800) Subject: nfc: nci: add missed destroy_workqueue in nci_register_device X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0b4a66a389d1ff5dab29f688fcfe36482bc889a2;p=linux.git nfc: nci: 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") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: David S. Miller --- diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 7cd5248843041..78ea8c94dcba0 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -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);