From: Johan Hovold <johan@kernel.org>
To: sayli karnik <karniksayli1995@gmail.com>
Cc: outreachy-kernel@googlegroups.com,
Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org
Subject: Re: [PATCH] staging: greybus: es2: Use kmemdup instead of kmalloc and memcpy
Date: Mon, 17 Oct 2016 17:19:53 +0200 [thread overview]
Message-ID: <20161017151953.GC23255@localhost> (raw)
In-Reply-To: <20161016084948.GA25576@sayli-HP-15-Notebook-PC>
[+CC: staging list ]
On Sun, Oct 16, 2016 at 02:19:48PM +0530, sayli karnik wrote:
> This patch replaces kmalloc and memcpy with kmemdup for duplication of
> memory.
>
> Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
> ---
> drivers/staging/greybus/es2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c
> index 071bb1c..8eabc71 100644
> --- a/drivers/staging/greybus/es2.c
> +++ b/drivers/staging/greybus/es2.c
> @@ -175,10 +175,9 @@ static int output_sync(struct es2_ap_dev *es2, void *req, u16 size, u8 cmd)
> u8 *data;
> int retval;
>
> - data = kmalloc(size, GFP_KERNEL);
> + data = kmemdup(req, size, GFP_KERNEL);
> if (!data)
> return -ENOMEM;
> - memcpy(data, req, size);
>
> retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
> cmd,
Thanks,
Johan
prev parent reply other threads:[~2016-10-17 15:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-16 8:49 [PATCH] staging: greybus: es2: Use kmemdup instead of kmalloc and memcpy sayli karnik
2016-10-17 15:19 ` Johan Hovold [this message]
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=20161017151953.GC23255@localhost \
--to=johan@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=karniksayli1995@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.