diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2009-04-20 12:18:43 -0600 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-04-20 12:18:43 -0600 |
commit | 6d25b688ecc488753af3c9e6f6a9a575b863cf37 (patch) | |
tree | a224acb81c9fc52ed573bb956fea6693420e5989 /arch/powerpc | |
parent | 8db70d3deee33e661d091b3e317fccc87bf0975d (diff) | |
download | linux-3.10-6d25b688ecc488753af3c9e6f6a9a575b863cf37.tar.gz linux-3.10-6d25b688ecc488753af3c9e6f6a9a575b863cf37.tar.bz2 linux-3.10-6d25b688ecc488753af3c9e6f6a9a575b863cf37.zip |
powerpc: Fix of_node_put() exit path in of_irq_map_one()
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/prom_parse.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 8f0856f312d..8362620c9e6 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c @@ -971,7 +971,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq struct device_node *p; const u32 *intspec, *tmp, *addr; u32 intsize, intlen; - int res; + int res = -EINVAL; DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index); @@ -995,21 +995,20 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq /* Get size of interrupt specifier */ tmp = of_get_property(p, "#interrupt-cells", NULL); - if (tmp == NULL) { - of_node_put(p); - return -EINVAL; - } + if (tmp == NULL) + goto out; intsize = *tmp; DBG(" intsize=%d intlen=%d\n", intsize, intlen); /* Check index */ if ((index + 1) * intsize > intlen) - return -EINVAL; + goto out; /* Get new specifier and map it */ res = of_irq_map_raw(p, intspec + index * intsize, intsize, addr, out_irq); +out: of_node_put(p); return res; } |