From: Manivannan Sadhasivam <mani@kernel.org>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: jdmason@kudzu.us, dave.jiang@intel.com, allenbh@gmail.com,
lpieralisi@kernel.org, kw@linux.com, kishon@kernel.org,
bhelgaas@google.com, ntb@lists.linux.dev,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: endpoint: pci-epf-ntb: Add missing check for alloc_workqueue
Date: Sat, 8 Apr 2023 15:03:16 +0530 [thread overview]
Message-ID: <20230408093316.GE11124@thinkpad> (raw)
In-Reply-To: <20230104091601.22719-1-jiasheng@iscas.ac.cn>
On Wed, Jan 04, 2023 at 05:16:01PM +0800, Jiasheng Jiang wrote:
> Add check for the return value of alloc_workqueue since it may return
> NULL pointer.
>
> Fixes: 8b821cf76150 ("PCI: endpoint: Add EP function driver to provide NTB functionality")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/pci/endpoint/functions/pci-epf-ntb.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-ntb.c b/drivers/pci/endpoint/functions/pci-epf-ntb.c
> index 9a00448c7e61..304956bc0516 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-ntb.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-ntb.c
> @@ -2124,6 +2124,9 @@ static int __init epf_ntb_init(void)
>
> kpcintb_workqueue = alloc_workqueue("kpcintb", WQ_MEM_RECLAIM |
> WQ_HIGHPRI, 0);
> + if (!kpcintb_workqueue)
> + return -ENOMEM;
> +
> ret = pci_epf_register_driver(&epf_ntb_driver);
> if (ret) {
> destroy_workqueue(kpcintb_workqueue);
> --
> 2.25.1
>
--
மணிவண்ணன் சதாசிவம்
prev parent reply other threads:[~2023-04-08 9:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 9:16 [PATCH] PCI: endpoint: pci-epf-ntb: Add missing check for alloc_workqueue Jiasheng Jiang
2023-04-08 9:33 ` Manivannan Sadhasivam [this message]
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=20230408093316.GE11124@thinkpad \
--to=mani@kernel.org \
--cc=allenbh@gmail.com \
--cc=bhelgaas@google.com \
--cc=dave.jiang@intel.com \
--cc=jdmason@kudzu.us \
--cc=jiasheng@iscas.ac.cn \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=ntb@lists.linux.dev \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).