From: Ralf Baechle Date: Thu, 10 Mar 2005 17:34:03 +0000 (+0000) Subject: qtronix.c: Handle kmalloc failure. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=96ed748d9da03d091799f8107fce27d218fd8f5c;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git qtronix.c: Handle kmalloc failure. Signed-off-by: Ralf Baechle --- diff --git a/drivers/char/qtronix.c b/drivers/char/qtronix.c index 40a3cf62e1a8..601d09baf9d7 100644 --- a/drivers/char/qtronix.c +++ b/drivers/char/qtronix.c @@ -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);