lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20180920154130.GA7693@e107981-ln.cambridge.arm.com>
Date:   Thu, 20 Sep 2018 16:41:37 +0100
From:   Lorenzo Pieralisi <lorenzo.pieralisi@....com>
To:     Wei Yongjun <weiyongjun1@...wei.com>
Cc:     "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        devel@...uxdriverproject.org, linux-pci@...r.kernel.org,
        kernel-janitors@...r.kernel.org,
        David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots()

[+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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ