patch-2.2.18 linux/drivers/char/qpmouse.c

Next file: linux/drivers/char/radio-cadet.c
Previous file: linux/drivers/char/q40_keyb.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/char/qpmouse.c linux/drivers/char/qpmouse.c
@@ -349,9 +349,14 @@
 
 	printk(KERN_INFO "82C710 type pointing device detected -- driver installed.\n");
 /*	printk("82C710 address = %x (should be 0x310)\n", qp_data); */
+	queue = (struct qp_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
+	if(queue==NULL)
+	{
+		printk(KERN_ERR "qpmouse: no queue memory.\n");
+		return -ENOMEM;
+	}	
 	qp_present = 1;
 	misc_register(&qp_mouse);
-	queue = (struct qp_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
 	memset(queue, 0, sizeof(*queue));
 	queue->head = queue->tail = 0;
 	queue->proc_list = NULL;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)