From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UCS5f-0004ZY-Le for barebox@lists.infradead.org; Mon, 04 Mar 2013 09:53:52 +0000 From: Sascha Hauer Date: Mon, 4 Mar 2013 10:53:29 +0100 Message-Id: <1362390820-10333-27-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1362390820-10333-1-git-send-email-s.hauer@pengutronix.de> References: <1362390820-10333-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 26/37] of: make value of property in of_new_property optional To: barebox@lists.infradead.org Signed-off-by: Sascha Hauer --- 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 9f9d9a0..5891138 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -677,8 +677,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