Skip to content

Commit

Permalink
nfc: nci: add missed destroy_workqueue in nci_register_device
Browse files Browse the repository at this point in the history
When nfc_register_device fails in nci_register_device,
destroy_workqueue() shouled be called to destroy ndev->tx_wq.

Fixes: 3c1c0f5 ("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>
  • Loading branch information
Wang Hai authored and David S. Miller committed Jul 17, 2020
1 parent 1291517 commit 0b4a66a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/nfc/nci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 0b4a66a

Please sign in to comment.