9
0
Fork 0

of: make value of property in of_new_property optional

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-02-21 00:19:37 +01:00
parent c2189e9f7e
commit 1ad17a65c3
1 changed files with 4 additions and 2 deletions

View File

@ -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);