Commit eeb09506 authored by Stephen Boyd's avatar Stephen Boyd Committed by Rob Herring

of/resolver: Replace kmalloc + memcpy with kmemdup()

Save one line.
Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
Reviewed-by: default avatarFrank Rowand <frowand.list@gmail.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent d35d623f
......@@ -84,10 +84,9 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
int offset, len;
int err = 0;
value = kmalloc(prop_fixup->length, GFP_KERNEL);
value = kmemdup(prop_fixup->value, prop_fixup->length, GFP_KERNEL);
if (!value)
return -ENOMEM;
memcpy(value, prop_fixup->value, prop_fixup->length);
/* prop_fixup contains a list of tuples of path:property_name:offset */
end = value + prop_fixup->length;
......
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