From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Pieralisi Subject: Re: [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots() Date: Thu, 20 Sep 2018 16:41:37 +0100 Message-ID: <20180920154130.GA7693@e107981-ln.cambridge.arm.com> References: <1537425631-28460-1-git-send-email-weiyongjun1@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Bjorn Helgaas , devel@linuxdriverproject.org, linux-pci@vger.kernel.org, kernel-janitors@vger.kernel.org, David Miller , netdev@vger.kernel.org To: Wei Yongjun Return-path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48156 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727710AbeITVZw (ORCPT ); Thu, 20 Sep 2018 17:25:52 -0400 Content-Disposition: inline In-Reply-To: <1537425631-28460-1-git-send-email-weiyongjun1@huawei.com> Sender: netdev-owner@vger.kernel.org List-ID: [+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 > --- > 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