Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: return -ENOMEM in select drivers when memory allocation fails

Instead of using -1 let's start using proper error codes.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Davidlohr Bueso and committed by
Dmitry Torokhov
6792cbbb 7aed3fb7

+4 -4
+1 -1
drivers/input/misc/powermate.c
··· 280 280 281 281 pm->configcr = kmalloc(sizeof(*(pm->configcr)), GFP_KERNEL); 282 282 if (!pm->configcr) 283 - return -1; 283 + return -ENOMEM; 284 284 285 285 return 0; 286 286 }
+1 -1
drivers/input/mouse/elantech.c
··· 699 699 700 700 psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); 701 701 if (!etd) 702 - return -1; 702 + return -ENOMEM; 703 703 704 704 etd->parity[0] = 1; 705 705 for (i = 1; i < 256; i++)
+1 -1
drivers/input/mouse/synaptics.c
··· 731 731 732 732 psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); 733 733 if (!priv) 734 - return -1; 734 + return -ENOMEM; 735 735 736 736 psmouse_reset(psmouse); 737 737
+1 -1
drivers/input/mouse/trackpoint.c
··· 303 303 304 304 psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL); 305 305 if (!psmouse->private) 306 - return -1; 306 + return -ENOMEM; 307 307 308 308 psmouse->vendor = "IBM"; 309 309 psmouse->name = "TrackPoint";