mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Panagiotis Issaris" <panagiotis.issaris@mech.kuleuven.ac.be>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] qtronix missing failure handling
Date: Sat, 5 Mar 2005 16:08:44 +0100	[thread overview]
Message-ID: <20050305150844.GA7544@mech.kuleuven.ac.be> (raw)

Hi,

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

Signed-off-by: Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>

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/

             reply	other threads:[~2005-03-05 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-05 15:08 Panagiotis Issaris [this message]
2005-03-10 17:28 ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050305150844.GA7544@mech.kuleuven.ac.be \
    --to=panagiotis.issaris@mech.kuleuven.ac.be \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®