2005-03-05 15:10:44

by Panagiotis Issaris

[permalink] [raw]
Subject: [PATCH] qtronix missing failure handling

Hi,

The Qtronix keyboard driver doesn't handle the possible failure of memory
allocation.

Signed-off-by: Panagiotis Issaris <[email protected]>

diff -pruN linux-2.6.11-mm1/drivers/char/qtronix.c linux-2.6.11-mm1-pi/drivers/char/qtronix.c
--- linux-2.6.11-mm1/drivers/char/qtronix.c 2005-03-05 15:56:43.000000000 +0100
+++ linux-2.6.11-mm1-pi/drivers/char/qtronix.c 2005-03-05 15:57:22.000000000 +0100
@@ -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);
--
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group
http://people.mech.kuleuven.ac.be/~pissaris/


2005-03-10 17:36:01

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH] qtronix missing failure handling

On Sat, Mar 05, 2005 at 04:08:44PM +0100, Panagiotis Issaris wrote:

> Hi,
>
> The Qtronix keyboard driver doesn't handle the possible failure of memory
> allocation.

Thanks, applied.

Please copy Linux/MIPS-specific patches to me or [email protected];
it was more a coincidence that I noticed your patch on this list.

Thanks,

Ralf