summaryrefslogtreecommitdiffstats
path: root/drivers/of/irq.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-09-19 11:01:52 -0500
committerGrant Likely <grant.likely@linaro.org>2013-10-15 20:09:19 +0100
commit8804827b305dbc1c6e24f2b36f1df4a9856b80e8 (patch)
tree9410216049081192e8b903e75454ffaf892639d3 /drivers/of/irq.c
parentf3cea45a77c8ebdb7efad100e576eb6cb401bf25 (diff)
downloadop-kernel-dev-8804827b305dbc1c6e24f2b36f1df4a9856b80e8.zip
op-kernel-dev-8804827b305dbc1c6e24f2b36f1df4a9856b80e8.tar.gz
of: Fix dereferencing node name in debug output to be safe
Several locations in the of_address and of_irq code dereference the full_name parameter from a device_node pointer without checking if the pointer is valid. This patch switches to use of_node_full_name() which always checks the pointer. Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of/irq.c')
-rw-r--r--drivers/of/irq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 1752988..f5fa5d8 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -102,7 +102,7 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
int imaplen, match, i;
pr_debug("of_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
- parent->full_name, be32_to_cpup(intspec),
+ of_node_full_name(parent), be32_to_cpup(intspec),
be32_to_cpup(intspec + 1), ointsize);
ipar = of_node_get(parent);
@@ -126,7 +126,7 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
goto fail;
}
- pr_debug("of_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize);
+ pr_debug("of_irq_map_raw: ipar=%s, size=%d\n", of_node_full_name(ipar), intsize);
if (ointsize != intsize)
return -EINVAL;
@@ -287,7 +287,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
u32 intsize, intlen;
int res = -EINVAL;
- pr_debug("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index);
+ pr_debug("of_irq_map_one: dev=%s, index=%d\n", of_node_full_name(device), index);
/* OldWorld mac stuff is "special", handle out of line */
if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
@@ -355,7 +355,7 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
r->start = r->end = irq;
r->flags = IORESOURCE_IRQ;
- r->name = name ? name : dev->full_name;
+ r->name = name ? name : of_node_full_name(dev);
}
return irq;
OpenPOWER on IntegriCloud