diff options
author | Stephen Boyd <stephen.boyd@linaro.org> | 2017-10-13 00:35:58 -0700 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2017-10-16 16:43:29 -0500 |
commit | eeb09506c58a326e1c571b7f9ee30b7fdbc6239d (patch) | |
tree | 272b60932b77a17b68436372a584c14567161430 | |
parent | d35d623f52f9bf58b2dc2fa08156de936e1d6770 (diff) |
of/resolver: Replace kmalloc + memcpy with kmemdup()
Save one line.
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r-- | drivers/of/resolver.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index 2d58253bf2f7..bd21a66f6930 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -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; |