Commit 9a7dd652 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: fix a couple small OF device tree bugs which were overlooked, from Joel Schopp

From: Anton Blanchard <anton@samba.org>

fix a couple small OF device tree bugs which were overlooked, from Joel Schopp
parent 0f81ecbf
......@@ -254,7 +254,7 @@ static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t coun
tmp++;
if (!strcmp(kbuf, "add_node"))
rv = do_add_node(tmp, 1 + count - (tmp - kbuf));
rv = do_add_node(tmp, count - (tmp - kbuf));
else if (!strcmp(kbuf, "remove_node"))
rv = do_remove_node(tmp);
else
......@@ -334,11 +334,12 @@ static struct property *new_property(const char *name, const int length, const u
if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL)))
goto cleanup;
if (!(new->value = kmalloc(length, GFP_KERNEL)))
if (!(new->value = kmalloc(length + 1, GFP_KERNEL)))
goto cleanup;
strcpy(new->name, name);
memcpy(new->value, value, length);
*(((char *)new->value) + length) = 0;
new->length = length;
new->next = last;
return new;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment