of: make value of property in of_new_property optional
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
c2189e9f7e
commit
1ad17a65c3
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue