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.

-- 
Andrey Panin            | Embedded systems software engineer
[EMAIL PROTECTED]        | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc
diff -u -X /usr/dontdiff /linux.vanilla/drivers/char/pc_keyb.c 
/linux/drivers/char/pc_keyb.c
--- /linux.vanilla/drivers/char/pc_keyb.c       Tue Jun 12 10:51:25 2001
+++ /linux/drivers/char/pc_keyb.c       Tue Jun 12 13:51:26 2001
@@ -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);

PGP signature

Reply via email to