From: Markus Elfring <Markus.Elfring@web.de>
To: Wang Hai <wanghai38@huawei.com>, netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Vincent Cuissard <cuissard@marvell.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v2] nfc: nci: add missed destroy_workqueue in nci_register_device
Date: Fri, 17 Jul 2020 09:47:41 +0200 [thread overview]
Message-ID: <26e73d0c-4afb-2c14-d411-6d14c5007419@web.de> (raw)
> 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
…
> +++ 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
next reply other threads:[~2020-07-17 7:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 7:47 Markus Elfring [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-17 7:10 [PATCH v2] nfc: nci: add missed destroy_workqueue in nci_register_device Wang Hai
2020-07-17 20:08 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26e73d0c-4afb-2c14-d411-6d14c5007419@web.de \
--to=markus.elfring@web.de \
--cc=cuissard@marvell.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=wanghai38@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).