powerpc: Fix of_node_put() exit path in of_irq_map_one()
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
committed by
Grant Likely
parent
8db70d3dee
commit
6d25b688ec
@@ -971,7 +971,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
|
|||||||
struct device_node *p;
|
struct device_node *p;
|
||||||
const u32 *intspec, *tmp, *addr;
|
const u32 *intspec, *tmp, *addr;
|
||||||
u32 intsize, intlen;
|
u32 intsize, intlen;
|
||||||
int res;
|
int res = -EINVAL;
|
||||||
|
|
||||||
DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index);
|
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 */
|
/* Get size of interrupt specifier */
|
||||||
tmp = of_get_property(p, "#interrupt-cells", NULL);
|
tmp = of_get_property(p, "#interrupt-cells", NULL);
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL)
|
||||||
of_node_put(p);
|
goto out;
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
intsize = *tmp;
|
intsize = *tmp;
|
||||||
|
|
||||||
DBG(" intsize=%d intlen=%d\n", intsize, intlen);
|
DBG(" intsize=%d intlen=%d\n", intsize, intlen);
|
||||||
|
|
||||||
/* Check index */
|
/* Check index */
|
||||||
if ((index + 1) * intsize > intlen)
|
if ((index + 1) * intsize > intlen)
|
||||||
return -EINVAL;
|
goto out;
|
||||||
|
|
||||||
/* Get new specifier and map it */
|
/* Get new specifier and map it */
|
||||||
res = of_irq_map_raw(p, intspec + index * intsize, intsize,
|
res = of_irq_map_raw(p, intspec + index * intsize, intsize,
|
||||||
addr, out_irq);
|
addr, out_irq);
|
||||||
|
out:
|
||||||
of_node_put(p);
|
of_node_put(p);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user