qtronix.c: Handle kmalloc failure.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
9ff77c469e
commit
96ed748d9d
1 changed files with 5 additions and 0 deletions
|
@ -591,6 +591,11 @@ static int __init psaux_init(void)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
|
queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
|
||||||
|
if (!queue) {
|
||||||
|
misc_deregister(&psaux_mouse);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
memset(queue, 0, sizeof(*queue));
|
memset(queue, 0, sizeof(*queue));
|
||||||
queue->head = queue->tail = 0;
|
queue->head = queue->tail = 0;
|
||||||
init_waitqueue_head(&queue->proc_list);
|
init_waitqueue_head(&queue->proc_list);
|
||||||
|
|
Loading…
Add table
Reference in a new issue