qtronix.c: Handle kmalloc failure.
authorRalf Baechle <ralf@linux-mips.org>
Thu, 10 Mar 2005 17:34:03 +0000 (17:34 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 29 Oct 2005 18:30:55 +0000 (19:30 +0100)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
drivers/char/qtronix.c

index 40a3cf62e1a841ff0f5393ae3e6f4eb480000285..601d09baf9d76b04812b1471c611335b20b18ad4 100644 (file)
@@ -591,6 +591,11 @@ static int __init psaux_init(void)
                return retval;
 
        queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
+       if (!queue) {
+               misc_deregister(&psaux_mouse);
+               return -ENOMEM;
+       }
+               
        memset(queue, 0, sizeof(*queue));
        queue->head = queue->tail = 0;
        init_waitqueue_head(&queue->proc_list);