All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots()
@ 2018-09-20  6:40 ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2018-09-20  6:40 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Lorenzo Pieralisi, Bjorn Helgaas
  Cc: Wei Yongjun, devel, linux-pci, kernel-janitors

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;
+		}
 	}
 }

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

* [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots()
@ 2018-09-20  6:40 ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2018-09-20  6:40 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Lorenzo Pieralisi, Bjorn Helgaas
  Cc: Wei Yongjun, devel, linux-pci, kernel-janitors

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;
+		}
 	}
 }


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

* Re: [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots()
  2018-09-20  6:40 ` Wei Yongjun
@ 2018-09-20 15:28   ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Pieralisi @ 2018-09-20 15:28 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Bjorn Helgaas, devel, linux-pci, kernel-janitors, David Miller,
	netdev

[+DaveM, netdev]

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;
> +             }
>       }
>  }
>

FYI

I am dropping this patch from the PCI queue since the original series
is now queued in net-next.

Lorenzo
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots()
@ 2018-09-20 15:28   ` Lorenzo Pieralisi
  0 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Pieralisi @ 2018-09-20 15:28 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Bjorn Helgaas, devel, linux-pci, kernel-janitors, David Miller,
	netdev

[+DaveM, netdev]

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;
> +             }
>       }
>  }
>

FYI

I am dropping this patch from the PCI queue since the original series
is now queued in net-next.

Lorenzo
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots()
  2018-09-20  6:40 ` Wei Yongjun
@ 2018-09-20 15:41   ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Pieralisi @ 2018-09-20 15:41 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Bjorn Helgaas, devel, linux-pci, kernel-janitors, David Miller,
	netdev

[+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

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

* Re: [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots()
@ 2018-09-20 15:41   ` Lorenzo Pieralisi
  0 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Pieralisi @ 2018-09-20 15:41 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Bjorn Helgaas, devel, linux-pci, kernel-janitors, David Miller,
	netdev

[+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

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

* [PATCH RESEND] PCI: hv: Fix return value check in hv_pci_assign_slots()
  2018-09-20  6:40 ` Wei Yongjun
@ 2018-09-21  2:53   ` Wei Yongjun
  -1 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2018-09-21  2:53 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Lorenzo Pieralisi, Bjorn Helgaas
  Cc: Wei Yongjun, devel, linux-pci, netdev, kernel-janitors

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>
---
Since the orig patch is merged from net tree, cc netdev@vger.kernel.org
---
 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;
+		}
 	}
 }

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

* [PATCH RESEND] PCI: hv: Fix return value check in hv_pci_assign_slots()
@ 2018-09-21  2:53   ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2018-09-21  2:53 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Lorenzo Pieralisi, Bjorn Helgaas
  Cc: Wei Yongjun, devel, linux-pci, netdev, kernel-janitors

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>
---
Since the orig patch is merged from net tree, cc netdev@vger.kernel.org
---
 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;
+		}
 	}
 }

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

end of thread, other threads:[~2018-09-21  8:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20  6:40 [PATCH] PCI: hv: Fix return value check in hv_pci_assign_slots() Wei Yongjun
2018-09-20  6:40 ` Wei Yongjun
2018-09-20 15:28 ` Lorenzo Pieralisi
2018-09-20 15:28   ` Lorenzo Pieralisi
2018-09-20 15:41 ` Lorenzo Pieralisi
2018-09-20 15:41   ` Lorenzo Pieralisi
2018-09-21  2:53 ` [PATCH RESEND] " Wei Yongjun
2018-09-21  2:53   ` Wei Yongjun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.