From: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stephen Boyd
<stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] of/resolver: Replace kmalloc + memcpy with kmemdup()
Date: Fri, 13 Oct 2017 15:33:07 -0700 [thread overview]
Message-ID: <59E13F23.4030201@gmail.com> (raw)
In-Reply-To: <20171013073558.11518-3-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
On 10/13/17 00:35, Stephen Boyd wrote:
> Save one line.
>
> Signed-off-by: Stephen Boyd <stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-10-13 22:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 7:35 [PATCH 0/2] Trivial code cleanup for DT resolver Stephen Boyd
2017-10-13 7:35 ` [PATCH 1/2] of/resolver: Simplify to be32_add_cpu() Stephen Boyd
[not found] ` <20171013073558.11518-2-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-13 22:52 ` Frank Rowand
2017-10-13 7:35 ` [PATCH 2/2] of/resolver: Replace kmalloc + memcpy with kmemdup() Stephen Boyd
[not found] ` <20171013073558.11518-3-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-13 22:33 ` Frank Rowand [this message]
2017-10-16 21:48 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59E13F23.4030201@gmail.com \
--to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).