From: Jiri Kosina <jikos@kernel.org>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Kosina <jikos@jikos.cz>
Subject: Re: [PATCH] HID: hid-logitech-hidpp: add NULL check on devm_kmemdup() return value
Date: Thu, 20 Jul 2017 15:46:18 +0200 (CEST) [thread overview]
Message-ID: <alpine.LSU.2.20.1707201546030.4705@cbobk.fhfr.pm> (raw)
In-Reply-To: <20170707051213.GA6074@embeddedgus>
On Fri, 7 Jul 2017, Gustavo A. R. Silva wrote:
> Check return value from call to devm_kmemdup()
> in order to prevent a NULL pointer dereference.
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> drivers/hid/hid-logitech-hidpp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> index 41b3946..501e16a 100644
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
> @@ -2732,6 +2732,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
> hidpp_battery_props,
> sizeof(hidpp_battery_props),
> GFP_KERNEL);
> + if (!battery_props)
> + return -ENOMEM;
> +
Applied to for-4.13/upstream-fixes, thanks.
--
Jiri Kosina
SUSE Labs
prev parent reply other threads:[~2017-07-20 13:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-07 5:12 Gustavo A. R. Silva
2017-07-12 7:40 ` Benjamin Tissoires
2017-07-17 5:00 ` Gustavo A. R. Silva
2017-07-20 13:46 ` Jiri Kosina [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=alpine.LSU.2.20.1707201546030.4705@cbobk.fhfr.pm \
--to=jikos@kernel.org \
--cc=benjamin.tissoires@redhat.com \
--cc=garsilva@embeddedor.com \
--cc=jikos@jikos.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®