linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] Input: wacom - check for allocation failure in probe()
@ 2012-03-27 20:15 Dan Carpenter
  2012-03-27 20:39 ` Chris Bagwell
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-03-27 20:15 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Chris Bagwell, Eduard Hasenleithner, Jason Gerecke,
	linux-input, kernel-janitors

We accidentally removed the check for NULL in 3aac0ef10b "Input: wacom -
isolate input registration".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 19ba586..0d26921 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -1002,6 +1002,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 		return -EINVAL;
 
 	wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
+	if (!wacom)
+		return -ENOMEM;
 
 	wacom_wac = &wacom->wacom_wac;
 	wacom_wac->features = *((struct wacom_features *)id->driver_info);

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

* Re: [patch] Input: wacom - check for allocation failure in probe()
  2012-03-27 20:15 [patch] Input: wacom - check for allocation failure in probe() Dan Carpenter
@ 2012-03-27 20:39 ` Chris Bagwell
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Bagwell @ 2012-03-27 20:39 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Dmitry Torokhov, Ping Cheng, Eduard Hasenleithner, Jason Gerecke,
	linux-input, kernel-janitors

Thanks for catch.

Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>

On Tue, Mar 27, 2012 at 3:15 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We accidentally removed the check for NULL in 3aac0ef10b "Input: wacom -
> isolate input registration".
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index 19ba586..0d26921 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -1002,6 +1002,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
>                return -EINVAL;
>
>        wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
> +       if (!wacom)
> +               return -ENOMEM;
>
>        wacom_wac = &wacom->wacom_wac;
>        wacom_wac->features = *((struct wacom_features *)id->driver_info);
--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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] 2+ messages in thread

end of thread, other threads:[~2012-03-27 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-27 20:15 [patch] Input: wacom - check for allocation failure in probe() Dan Carpenter
2012-03-27 20:39 ` Chris Bagwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).