Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wang Hai and committed by
David S. Miller
0b4a66a3 12915174

+4 -1
+4 -1
net/nfc/nci/core.c
··· 1228 1228 1229 1229 rc = nfc_register_device(ndev->nfc_dev); 1230 1230 if (rc) 1231 - goto destroy_rx_wq_exit; 1231 + goto destroy_tx_wq_exit; 1232 1232 1233 1233 goto exit; 1234 + 1235 + destroy_tx_wq_exit: 1236 + destroy_workqueue(ndev->tx_wq); 1234 1237 1235 1238 destroy_rx_wq_exit: 1236 1239 destroy_workqueue(ndev->rx_wq);