[PATCH 03/11] of: partition: Check for valid partition name
Sascha Hauer
s.hauer at pengutronix.de
Mon Sep 16 04:48:12 EDT 2013
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/of/partition.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index 7199eff..5ed44a8 100644
--- a/drivers/of/partition.c
+++ b/drivers/of/partition.c
@@ -47,6 +47,9 @@ struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node)
partname = of_get_property(node, "label", &len);
if (!partname)
partname = of_get_property(node, "name", &len);
+ if (!partname)
+ return NULL;
+
name = (char *)partname;
debug("add partition: %s.%s 0x%08lx 0x%08lx\n", cdev->name, partname, offset, size);
--
1.8.4.rc3
More information about the barebox
mailing list