Skip to contentSkip to conversation

Input: wacom - check for allocation failure in probe()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 27, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: wacom - check for allocation failure in probe()

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

drivers/input/tablet/wacom_sys.c +2 -0
index 19ba586..0d26921 100644
@@ -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);
Reviewed-by on v1 1/1
#1 lore raw

Thanks for catch.

Quoted 10 lines · Dan Carpenter

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

drivers/input/tablet/wacom_sys.c +0 -0
index 19ba586..0d26921 100644

drivers/input/tablet/wacom_sys.c static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i · line 1009

Quoted 8 lines
drivers/input/tablet/wacom_sys.c +2 -0
@@ -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 kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html