Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1433842

[PATCH] PCI: xilinx: Modify error handling

From Amitoj Kaur Chawla <amitoj1606@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] PCI: xilinx: Modify error handling
Date 2016-06-29 17:20 +0200
Message-ID <rPprr-5Ob-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] PCI: xilinx: Modify error handling Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2016-06-29 17:20 +0200

csiph-web