pc keyboard driver minor cleanup
PATCH 1/1 pc keyboard driver minor cleanup
Hi,
added misc_register() return value checking and removed panic() in case of kmalloc failure (IMHO it's possible to live without PS/2 mouse :)
Best regards.
Signature · 2 lines
Andrey Panin | Embedded systems software engineer [email protected] | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc
linux/drivers/char/pc_keyb.c renamed from linux.vanilla/drivers/char/pc_keyb.c +10 -3
@@ -1011,13 +1011,20 @@static int __init psaux_init (void ) { +int retval; +if (!detect_auxiliary_port ())return -EIO ; -misc_register (&psaux_mouse); +if ((retval =misc_register (&psaux_mouse))) +return retval; + queue = (struct aux_queue *)kmalloc (sizeof (*queue),GFP_KERNEL ); -if (queue ==NULL ) -panic ("psaux_init(): out of memory" ); +if (queue ==NULL ) { +printk (KERN_ERR "psaux_init(): out of memory\n" ); +misc_deregister (&psaux_mouse); +return -ENOMEM ; + }memset (queue,0 ,sizeof (*queue)); queue->head = queue->tail =0 ;init_waitqueue_head (&queue->proc_list);