public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Mario.Limonciello@dell.com
Cc: dan.carpenter@oracle.com, mjg59@srcf.ucam.org,
	pali.rohar@gmail.com, andy@infradead.org,
	platform-driver-x86@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] platform/x86: dell-wmi: check for kmalloc() errors
Date: Tue, 12 Dec 2017 00:35:39 +0000	[thread overview]
Message-ID: <20171212003539.GE27831@fury> (raw)
In-Reply-To: <ed9fa3c8c5bc45f58ff6844e628791a2@ausx13mpc120.AMER.DELL.COM>

On Mon, Dec 11, 2017 at 02:58:28PM +0000, Mario.Limonciello@dell.com wrote:
> > -----Original Message-----
> > From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> > Sent: Monday, December 11, 2017 4:54 AM
> > To: Matthew Garrett <mjg59@srcf.ucam.org>; Limonciello, Mario
> > <Mario_Limonciello@Dell.com>
> > Cc: Pali Rohár <pali.rohar@gmail.com>; Darren Hart <dvhart@infradead.org>;
> > Andy Shevchenko <andy@infradead.org>; platform-driver-x86@vger.kernel.org;
> > kernel-janitors@vger.kernel.org
> > Subject: [PATCH] platform/x86: dell-wmi: check for kmalloc() errors
> > 
> > This allocation won't fail in the current kernel because it's small but
> > not checking for kmalloc() failures introduces static checker warnings
> > so let's fix it.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> > index 39d2f4518483..fb25b20df316 100644
> > --- a/drivers/platform/x86/dell-wmi.c
> > +++ b/drivers/platform/x86/dell-wmi.c
> > @@ -639,6 +639,8 @@ static int dell_wmi_events_set_enabled(bool enable)
> >  	int ret;
> > 
> >  	buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
> > +	if (!buffer)
> > +		return -ENOMEM;
> >  	buffer->cmd_class = CLASS_INFO;
> >  	buffer->cmd_select = SELECT_APP_REGISTRATION;
> >  	buffer->input[0] = 0x10000;
> 
> Thanks for that.
> 
> Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>

Queued for testing, and I'll pull it back to fixes for rc3/4 as well.

-- 
Darren Hart
VMware Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2017-12-12  0:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 10:54 [PATCH] platform/x86: dell-wmi: check for kmalloc() errors Dan Carpenter
2017-12-11 14:58 ` Mario.Limonciello
2017-12-12  0:35   ` Darren Hart [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=20171212003539.GE27831@fury \
    --to=dvhart@infradead.org \
    --cc=Mario.Limonciello@dell.com \
    --cc=andy@infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali.rohar@gmail.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