summaryrefslogtreecommitdiff
path: root/drivers/of/address.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/address.c
parentf3cea45a77c8ebdb7efad100e576eb6cb401bf25 (diff)
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/address.c')
-rw-r--r--drivers/of/address.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c
index b55c21890760..71180b91bfbe 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -489,7 +489,7 @@ static u64 __of_translate_address(struct device_node *dev,
int na, ns, pna, pns;
u64 result = OF_BAD_ADDR;
- pr_debug("OF: ** translation for device %s **\n", dev->full_name);
+ pr_debug("OF: ** translation for device %s **\n", of_node_full_name(dev));
/* Increase refcount at current level */
of_node_get(dev);
@@ -504,13 +504,13 @@ static u64 __of_translate_address(struct device_node *dev,
bus->count_cells(dev, &na, &ns);
if (!OF_CHECK_COUNTS(na, ns)) {
printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
- dev->full_name);
+ of_node_full_name(dev));
goto bail;
}
memcpy(addr, in_addr, na * 4);
pr_debug("OF: bus is %s (na=%d, ns=%d) on %s\n",
- bus->name, na, ns, parent->full_name);
+ bus->name, na, ns, of_node_full_name(parent));
of_dump_addr("OF: translating address:", addr, na);
/* Translate */