mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <pazke@orbita1.ru>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] pc keyboard driver minor cleanup
Date: Wed, 13 Jun 2001 15:59:16 +0400	[thread overview]
Message-ID: <20010613155916.A22257@orbita1.ru> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 316 bytes --]

Hi,

added misc_register() return value checking and removed panic() in case of 
kmalloc failure (IMHO it's possible to live without PS/2 mouse :)

Best regards.

-- 
Andrey Panin            | Embedded systems software engineer
pazke@orbita1.ru        | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

[-- Attachment #1.2: patch-pckeyb --]
[-- Type: text/plain, Size: 848 bytes --]

diff -u -X /usr/dontdiff /linux.vanilla/drivers/char/pc_keyb.c /linux/drivers/char/pc_keyb.c
--- /linux.vanilla/drivers/char/pc_keyb.c	Tue Jun 12 10:51:25 2001
+++ /linux/drivers/char/pc_keyb.c	Tue Jun 12 13:51:26 2001
@@ -1011,13 +1011,20 @@
 
 static int __init psaux_init(void)
 {
+	int retval;
+
 	if (!detect_auxiliary_port())
 		return -EIO;
 
-	misc_register(&psaux_mouse);
+	if ((retval = misc_register(&psaux_mouse)))
+		return retval;
+
 	queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
-	if (queue == NULL)
-		panic("psaux_init(): out of memory");
+	if (queue == NULL) {
+		printk(KERN_ERR "psaux_init(): out of memory\n");
+		misc_deregister(&psaux_mouse);
+		return -ENOMEM;
+	}
 	memset(queue, 0, sizeof(*queue));
 	queue->head = queue->tail = 0;
 	init_waitqueue_head(&queue->proc_list);

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

                 reply	other threads:[~2001-06-13 11:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20010613155916.A22257@orbita1.ru \
    --to=pazke@orbita1.ru \
    --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®