From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
Bjorn Helgaas <bhelgaas@google.com>,
devel@linuxdriverproject.org, linux-pci@vger.kernel.org,
kernel-janitors@vger.kernel.org,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots()
Date: Thu, 20 Sep 2018 16:41:37 +0100 [thread overview]
Message-ID: <20180920154130.GA7693@e107981-ln.cambridge.arm.com> (raw)
In-Reply-To: <1537425631-28460-1-git-send-email-weiyongjun1@huawei.com>
[+DaveM, netdev]
Removed erroneously added disclaimer, apologies.
On Thu, Sep 20, 2018 at 06:40:31AM +0000, Wei Yongjun wrote:
> In case of error, the function pci_create_slot() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
>
> Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot information")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/pci/controller/pci-hyperv.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index ee80e79..9ba4d12 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -1484,8 +1484,10 @@ static void hv_pci_assign_slots(struct hv_pcibus_device *hbus)
> snprintf(name, SLOT_NAME_SIZE, "%u", hpdev->desc.ser);
> hpdev->pci_slot = pci_create_slot(hbus->pci_bus, slot_nr,
> name, NULL);
> - if (!hpdev->pci_slot)
> + if (IS_ERR(hpdev->pci_slot)) {
> pr_warn("pci_create slot %s failed\n", name);
> + hpdev->pci_slot = NULL;
> + }
> }
> }
I am dropping this patch from the PCI queue since the original series
is now queued in net-next.
Lorenzo
next prev parent reply other threads:[~2018-09-20 21:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1537425631-28460-1-git-send-email-weiyongjun1@huawei.com>
2018-09-20 15:28 ` [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots() Lorenzo Pieralisi
2018-09-20 15:41 ` Lorenzo Pieralisi [this message]
2018-09-21 2:53 ` [PATCH RESEND] " Wei Yongjun
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=20180920154130.GA7693@e107981-ln.cambridge.arm.com \
--to=lorenzo.pieralisi@arm.com \
--cc=bhelgaas@google.com \
--cc=davem@davemloft.net \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kys@microsoft.com \
--cc=linux-pci@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sthemmin@microsoft.com \
--cc=weiyongjun1@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