Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de>
---
 drivers/of/base.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 6b12979..c47801a 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -676,8 +676,10 @@ struct property *of_new_property(struct device_node *node, 
const char *name,
 
        prop->name = strdup(name);
        prop->length = len;
-       prop->value = xzalloc(len);
-       memcpy(prop->value, data, len);
+       if (len) {
+               prop->value = xzalloc(len);
+               memcpy(prop->value, data, len);
+       }
 
        list_add_tail(&prop->list, &node->properties);
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to