diff options
Diffstat (limited to 'drivers/irqchip/irq-mbigen.c')
-rw-r--r-- | drivers/irqchip/irq-mbigen.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index 3dd28382d5f5..3f09f658e8e2 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c | |||
@@ -241,12 +241,15 @@ static int mbigen_of_create_domain(struct platform_device *pdev, | |||
241 | 241 | ||
242 | parent = platform_bus_type.dev_root; | 242 | parent = platform_bus_type.dev_root; |
243 | child = of_platform_device_create(np, NULL, parent); | 243 | child = of_platform_device_create(np, NULL, parent); |
244 | if (!child) | 244 | if (!child) { |
245 | of_node_put(np); | ||
245 | return -ENOMEM; | 246 | return -ENOMEM; |
247 | } | ||
246 | 248 | ||
247 | if (of_property_read_u32(child->dev.of_node, "num-pins", | 249 | if (of_property_read_u32(child->dev.of_node, "num-pins", |
248 | &num_pins) < 0) { | 250 | &num_pins) < 0) { |
249 | dev_err(&pdev->dev, "No num-pins property\n"); | 251 | dev_err(&pdev->dev, "No num-pins property\n"); |
252 | of_node_put(np); | ||
250 | return -EINVAL; | 253 | return -EINVAL; |
251 | } | 254 | } |
252 | 255 | ||
@@ -254,8 +257,10 @@ static int mbigen_of_create_domain(struct platform_device *pdev, | |||
254 | mbigen_write_msg, | 257 | mbigen_write_msg, |
255 | &mbigen_domain_ops, | 258 | &mbigen_domain_ops, |
256 | mgn_chip); | 259 | mgn_chip); |
257 | if (!domain) | 260 | if (!domain) { |
261 | of_node_put(np); | ||
258 | return -ENOMEM; | 262 | return -ENOMEM; |
263 | } | ||
259 | } | 264 | } |
260 | 265 | ||
261 | return 0; | 266 | return 0; |