Skip to content

Commit

Permalink
qtronix.c: Handle kmalloc failure.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent 9ff77c4 commit 96ed748
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/char/qtronix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 96ed748

Please sign in to comment.