lkml.org 
[lkml]   [2001]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] pc keyboard driver minor cleanup
From
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.ascdiff -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);[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.027 / U:31.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site