All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: dell-wmi: check for kmalloc() errors
@ 2017-12-11 10:54 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2017-12-11 10:54 UTC (permalink / raw)
  To: Matthew Garrett, Mario Limonciello
  Cc: Pali Rohár, Darren Hart, Andy Shevchenko,
	platform-driver-x86, kernel-janitors

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;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] platform/x86: dell-wmi: check for kmalloc() errors
@ 2017-12-11 10:54 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2017-12-11 10:54 UTC (permalink / raw)
  To: Matthew Garrett, Mario Limonciello
  Cc: Pali Rohár, Darren Hart, Andy Shevchenko,
	platform-driver-x86, kernel-janitors

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;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH] platform/x86: dell-wmi: check for kmalloc() errors
  2017-12-11 10:54 ` Dan Carpenter
@ 2017-12-11 14:58   ` Mario.Limonciello
  -1 siblings, 0 replies; 6+ messages in thread
From: Mario.Limonciello @ 2017-12-11 14:58 UTC (permalink / raw)
  To: dan.carpenter, mjg59
  Cc: pali.rohar, dvhart, andy, platform-driver-x86, kernel-janitors

> -----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>
--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] platform/x86: dell-wmi: check for kmalloc() errors
@ 2017-12-11 14:58   ` Mario.Limonciello
  0 siblings, 0 replies; 6+ messages in thread
From: Mario.Limonciello @ 2017-12-11 14:58 UTC (permalink / raw)
  To: dan.carpenter, mjg59
  Cc: pali.rohar, dvhart, andy, platform-driver-x86, kernel-janitors

> -----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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] platform/x86: dell-wmi: check for kmalloc() errors
  2017-12-11 14:58   ` Mario.Limonciello
@ 2017-12-12  0:35     ` Darren Hart
  -1 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2017-12-12  0:35 UTC (permalink / raw)
  To: Mario.Limonciello
  Cc: dan.carpenter, mjg59, pali.rohar, andy, platform-driver-x86,
	kernel-janitors

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] platform/x86: dell-wmi: check for kmalloc() errors
@ 2017-12-12  0:35     ` Darren Hart
  0 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2017-12-12  0:35 UTC (permalink / raw)
  To: Mario.Limonciello
  Cc: dan.carpenter, mjg59, pali.rohar, andy, platform-driver-x86,
	kernel-janitors

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-12  0:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-11 10:54 [PATCH] platform/x86: dell-wmi: check for kmalloc() errors Dan Carpenter
2017-12-11 10:54 ` Dan Carpenter
2017-12-11 14:58 ` Mario.Limonciello
2017-12-11 14:58   ` Mario.Limonciello
2017-12-12  0:35   ` Darren Hart
2017-12-12  0:35     ` Darren Hart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.