]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
irqchip/mbigen: Checking for IS_ERR() instead of NULL
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 4 Apr 2016 11:17:36 +0000 (14:17 +0300)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 11 May 2016 09:12:13 +0000 (10:12 +0100)
of_platform_device_create() returns NULL on error, it never returns
error pointers.

Fixes: ed2a1002d25c ('irqchip/mbigen: Handle multiple device nodes in a mbigen module')
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-mbigen.c

index d67baa231c1324af4f970aefd399d8b78fdf79b4..03b79b061d245bc40bd4b9b243d3ef79ac8549b2 100644 (file)
@@ -263,8 +263,8 @@ static int mbigen_device_probe(struct platform_device *pdev)
 
                parent = platform_bus_type.dev_root;
                child = of_platform_device_create(np, NULL, parent);
-               if (IS_ERR(child))
-                       return PTR_ERR(child);
+               if (!child)
+                       return -ENOMEM;
 
                if (of_property_read_u32(child->dev.of_node, "num-pins",
                                         &num_pins) < 0) {