linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] iov: add return failure condition for pci_setup_device
@ 2016-08-29  7:28 Po Liu
  2016-09-12 21:44 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Po Liu @ 2016-08-29  7:28 UTC (permalink / raw)
  To: linux-pci
  Cc: Roy Zang, Arnd Bergmann, Po Liu, Stuart Yoder, Yang-Leo Li,
	linux-arm-kernel, Bjorn Helgaas, Mingkai Hu

If pci_setup_device() return failure, return failure directly in the
pci_iov_add_virtfn().

Signed-off-by: Po Liu <po.liu@nxp.com>
---
 drivers/pci/iov.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 2194b44..e30f05c 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -136,7 +136,10 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)
 	virtfn->devfn = pci_iov_virtfn_devfn(dev, id);
 	virtfn->vendor = dev->vendor;
 	pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_DID, &virtfn->device);
-	pci_setup_device(virtfn);
+	rc = pci_setup_device(virtfn);
+	if (rc)
+		goto failed0;
+
 	virtfn->dev.parent = dev->dev.parent;
 	virtfn->physfn = pci_dev_get(dev);
 	virtfn->is_virtfn = 1;
-- 
2.1.0.27.g96db324


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] iov: add return failure condition for pci_setup_device
  2016-08-29  7:28 [PATCH v1] iov: add return failure condition for pci_setup_device Po Liu
@ 2016-09-12 21:44 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2016-09-12 21:44 UTC (permalink / raw)
  To: Po Liu
  Cc: linux-pci, Roy Zang, Arnd Bergmann, Stuart Yoder, Yang-Leo Li,
	linux-arm-kernel, Bjorn Helgaas, Mingkai Hu

On Mon, Aug 29, 2016 at 03:28:01PM +0800, Po Liu wrote:
> If pci_setup_device() return failure, return failure directly in the
> pci_iov_add_virtfn().
> 
> Signed-off-by: Po Liu <po.liu@nxp.com>

Applied to pci/virtualization for v4.9, thanks!

> ---
>  drivers/pci/iov.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index 2194b44..e30f05c 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -136,7 +136,10 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)
>  	virtfn->devfn = pci_iov_virtfn_devfn(dev, id);
>  	virtfn->vendor = dev->vendor;
>  	pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_DID, &virtfn->device);
> -	pci_setup_device(virtfn);
> +	rc = pci_setup_device(virtfn);
> +	if (rc)
> +		goto failed0;
> +
>  	virtfn->dev.parent = dev->dev.parent;
>  	virtfn->physfn = pci_dev_get(dev);
>  	virtfn->is_virtfn = 1;
> -- 
> 2.1.0.27.g96db324
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-12 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-29  7:28 [PATCH v1] iov: add return failure condition for pci_setup_device Po Liu
2016-09-12 21:44 ` Bjorn Helgaas

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).