From: "Pali Rohár" <pali.rohar@gmail.com>
To: Mario Limonciello <mario.limonciello@dell.com>
Cc: dvhart@infradead.org, Andy Shevchenko <andy.shevchenko@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 1/2] platform/x86: dell-wmi-descriptor: check if memory was allocated
Date: Thu, 9 Nov 2017 13:07:42 +0100 [thread overview]
Message-ID: <20171109120742.6ctactdfgygdati3@pali> (raw)
In-Reply-To: <cf25805c3f247ca5c710ad9971dbc7a50e4c872c.1509725778.git.mario.limonciello@dell.com>
On Friday 03 November 2017 11:27:21 Mario Limonciello wrote:
> devm_kzalloc will return NULL pointer if no memory was allocated.
> This should be checked. This problem also existed when the driver
> was dell-wmi.c.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
> ---
> drivers/platform/x86/dell-wmi-descriptor.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/platform/x86/dell-wmi-descriptor.c b/drivers/platform/x86/dell-wmi-descriptor.c
> index 3204c408e261..28ef5f37cfbf 100644
> --- a/drivers/platform/x86/dell-wmi-descriptor.c
> +++ b/drivers/platform/x86/dell-wmi-descriptor.c
> @@ -121,6 +121,11 @@ static int dell_wmi_descriptor_probe(struct wmi_device *wdev)
> priv = devm_kzalloc(&wdev->dev, sizeof(struct descriptor_priv),
> GFP_KERNEL);
>
> + if (!priv) {
> + ret = -ENOMEM;
> + goto out;
> + }
> +
> priv->interface_version = buffer[2];
> priv->size = buffer[3];
> ret = 0;
--
Pali Rohár
pali.rohar@gmail.com
next prev parent reply other threads:[~2017-11-09 12:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-03 16:27 [PATCH 0/2] Account for uncorrectable failures in probing Mario Limonciello
2017-11-03 16:27 ` [PATCH 1/2] platform/x86: dell-wmi-descriptor: check if memory was allocated Mario Limonciello
2017-11-09 12:07 ` Pali Rohár [this message]
2017-11-03 16:27 ` [PATCH 2/2] platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers Mario Limonciello
2017-11-04 0:53 ` Darren Hart
2017-11-04 3:25 ` Mario.Limonciello
2017-11-09 16:02 ` Pali Rohár
2017-11-09 16:13 ` Mario.Limonciello
2017-11-09 17:28 ` Pali Rohár
2017-11-09 17:34 ` Mario.Limonciello
2017-11-09 17:52 ` Darren Hart
2017-11-07 16:17 ` [PATCH 0/2] Account for uncorrectable failures in probing Mario.Limonciello
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=20171109120742.6ctactdfgygdati3@pali \
--to=pali.rohar@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@dell.com \
--cc=platform-driver-x86@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