[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <59E13F23.4030201@gmail.com>
Date: Fri, 13 Oct 2017 15:33:07 -0700
From: Frank Rowand <frowand.list@...il.com>
To: Stephen Boyd <stephen.boyd@...aro.org>,
Rob Herring <robh+dt@...nel.org>
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH 2/2] of/resolver: Replace kmalloc + memcpy with kmemdup()
On 10/13/17 00:35, Stephen Boyd wrote:
> Save one line.
>
> Signed-off-by: Stephen Boyd <stephen.boyd@...aro.org>
> ---
> drivers/of/resolver.c | 3 +--
> 1 file changed, 1 insertion(+), 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;
>
Reviewed-by: Frank Rowand <frowand.list@...il.com>
Powered by blists - more mailing lists