Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/mbigen: Checking for IS_ERR() instead of NULL

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>

authored by

Dan Carpenter and committed by
Marc Zyngier
086eec2d 074f23b6

+2 -2
+2 -2
drivers/irqchip/irq-mbigen.c
··· 263 263 264 264 parent = platform_bus_type.dev_root; 265 265 child = of_platform_device_create(np, NULL, parent); 266 - if (IS_ERR(child)) 267 - return PTR_ERR(child); 266 + if (!child) 267 + return -ENOMEM; 268 268 269 269 if (of_property_read_u32(child->dev.of_node, "num-pins", 270 270 &num_pins) < 0) {