Input: wacom - check for allocation failure in probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 30 Mar 2012 05:38:11 +0000 (22:38 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 30 Mar 2012 05:42:19 +0000 (22:42 -0700)
We accidentally removed the check for NULL in 3aac0ef10b "Input: wacom -
isolate input registration".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/tablet/wacom_sys.c

index 19ba58640dc2d3a12e96d24825ae96dc83b07fa8..0d269212931e86be95d4c77c26b667ac781200c2 100644 (file)
@@ -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);