linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: xilinx: Modify error handling
@ 2016-06-29 15:18 Amitoj Kaur Chawla
  2016-07-25 17:42 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Amitoj Kaur Chawla @ 2016-06-29 15:18 UTC (permalink / raw)
  To: bhelgaas, michal.simek, soren.brinkmann, linux-pci,
	linux-arm-kernel, linux-kernel
  Cc: julia.lawall

Failure of of_get_next_child returns NULL, not an ERR_PTR. Use
appropriate error code -ENODEV to be returned on failure instead.

The Coccinelle semantic patch used to find this issue is as follows:
@@
expression E,E1;
@@

if (
*   E == NULL
   ) { <+... when != E = E1
        PTR_ERR(E)
       ...+> }

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/pci/host/pcie-xilinx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index 65f0fe0..d76ea8d 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -550,7 +550,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
 	pcie_intc_node = of_get_next_child(node, NULL);
 	if (!pcie_intc_node) {
 		dev_err(dev, "No PCIe Intc node found\n");
-		return PTR_ERR(pcie_intc_node);
+		return -ENODEV;
 	}
 
 	port->irq_domain = irq_domain_add_linear(pcie_intc_node, 4,
-- 
1.9.1

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

* Re: [PATCH] PCI: xilinx: Modify error handling
  2016-06-29 15:18 [PATCH] PCI: xilinx: Modify error handling Amitoj Kaur Chawla
@ 2016-07-25 17:42 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2016-07-25 17:42 UTC (permalink / raw)
  To: Amitoj Kaur Chawla
  Cc: bhelgaas, michal.simek, soren.brinkmann, linux-pci,
	linux-arm-kernel, linux-kernel, julia.lawall

On Wed, Jun 29, 2016 at 08:48:20PM +0530, Amitoj Kaur Chawla wrote:
> Failure of of_get_next_child returns NULL, not an ERR_PTR. Use
> appropriate error code -ENODEV to be returned on failure instead.
> 
> The Coccinelle semantic patch used to find this issue is as follows:
> @@
> expression E,E1;
> @@
> 
> if (
> *   E == NULL
>    ) { <+... when != E = E1
>         PTR_ERR(E)
>        ...+> }
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  drivers/pci/host/pcie-xilinx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
> index 65f0fe0..d76ea8d 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -550,7 +550,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
>  	pcie_intc_node = of_get_next_child(node, NULL);
>  	if (!pcie_intc_node) {
>  		dev_err(dev, "No PCIe Intc node found\n");
> -		return PTR_ERR(pcie_intc_node);
> +		return -ENODEV;

This fix is included in the patch posted by Christophe JAILLET
<christophe.jaillet@wanadoo.fr>, along with two other similar fixes.
I applied Christophe's patch to pci/host-xilinx for v4.8.

>  	}
>  
>  	port->irq_domain = irq_domain_add_linear(pcie_intc_node, 4,
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-07-25 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29 15:18 [PATCH] PCI: xilinx: Modify error handling Amitoj Kaur Chawla
2016-07-25 17:42 ` 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).