[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.20.1707201546030.4705@cbobk.fhfr.pm>
Date: Thu, 20 Jul 2017 15:46:18 +0200 (CEST)
From: Jiri Kosina <jikos@...nel.org>
To: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
cc: Benjamin Tissoires <benjamin.tissoires@...hat.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Jiri Kosina <jikos@...os.cz>
Subject: Re: [PATCH] HID: hid-logitech-hidpp: add NULL check on devm_kmemdup()
return value
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@...eddedor.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
Powered by blists - more mailing lists