Re: [PATCH v2] nfc: nci: add missed destroy_workqueue in nci_register_device

From: Markus Elfring <hidden>
Date: 2020-07-17 07:48:25
Also in: kernel-janitors, lkml

When nfc_register_device fails in nci_register_device,
destroy_workqueue() shouled be called to destroy ndev->tx_wq.
Would an other imperative wording be preferred for the commit message?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=f8456690ba8eb18ea4714e68554e242a04f65cff#n151
quoted hunk
+++ 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);
…


How do you think about to use the following source code variant
for this function implementation?

	if (!rc)
		goto exit;

	destroy_workqueue(ndev->tx_wq);


Regards,
Markus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help