From: Lee Jones <lee.jones@linaro.org>
To: Greg KH <greg@kroah.com>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 4.19 2/3] media: siano: Use kmemdup instead of duplicating its function
Date: Wed, 27 Nov 2019 09:52:34 +0000 [thread overview]
Message-ID: <20191127095234.GL3296@dell> (raw)
In-Reply-To: <20191127075802.GA1822469@kroah.com>
On Wed, 27 Nov 2019, Greg KH wrote:
> On Wed, Nov 27, 2019 at 07:22:09AM +0000, Lee Jones wrote:
> > From: Wen Yang <wen.yang99@zte.com.cn>
> >
> > [ Upstream commit 0f4bb10857e22a657e6c8cca5d1d54b641e94628 ]
> >
> > kmemdup has implemented the function that kmalloc() + memcpy().
> > We prefer to kmemdup rather than code opened implementation.
> >
> > This issue was detected with the help of coccinelle.
> >
> > Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
> > CC: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
> > CC: linux-kernel@vger.kernel.org
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> > drivers/media/usb/siano/smsusb.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
> > index 3071d9bc77f4..38ea773eac97 100644
> > --- a/drivers/media/usb/siano/smsusb.c
> > +++ b/drivers/media/usb/siano/smsusb.c
> > @@ -225,10 +225,9 @@ static int smsusb_sendrequest(void *context, void *buffer, size_t size)
> > return -ENOENT;
> > }
> >
> > - phdr = kmalloc(size, GFP_KERNEL);
> > + phdr = kmemdup(buffer, size, GFP_KERNEL);
> > if (!phdr)
> > return -ENOMEM;
> > - memcpy(phdr, buffer, size);
> >
> > pr_debug("sending %s(%d) size: %d\n",
> > smscore_translate_msg(phdr->msg_type), phdr->msg_type,
>
> Why does this patch qualify for stable inclusion?
I'm guessing this question is rhetorical. :)
Please drop the patch.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2019-11-27 9:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 7:22 [PATCH 4.19 1/3] ARM: 8904/1: skip nomap memblocks while finding the lowmem/highmem boundary Lee Jones
2019-11-27 7:22 ` [PATCH 4.19 2/3] media: siano: Use kmemdup instead of duplicating its function Lee Jones
2019-11-27 7:58 ` Greg KH
2019-11-27 9:52 ` Lee Jones [this message]
2019-11-27 7:22 ` [PATCH 4.19 3/3] ocfs2: remove ocfs2_is_o2cb_active() Lee Jones
-- strict thread matches above, loose matches on Subject: below --
2019-11-26 13:47 [PATCH 4.19 1/3] ARM: 8904/1: skip nomap memblocks while finding the lowmem/highmem boundary Lee Jones
2019-11-26 13:47 ` [PATCH 4.19 2/3] media: siano: Use kmemdup instead of duplicating its function Lee Jones
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=20191127095234.GL3296@dell \
--to=lee.jones@linaro.org \
--cc=greg@kroah.com \
--cc=stable@vger.kernel.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).