lkml.org 
[lkml]   [2002]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] TRIVIAL II: 2.5.6-pre3. misc_register/request_region
Date
Linus, please apply: these are the small subset which were obviously correct.

Evgeniy Polyakov <johnpol@2ka.mipt.ru>:
Patches check return values for request_region() and misc_register().
This patches make janitorial project TODO list a bit smaller.

Thanks,
Rusty.

diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.6-pre3/arch/mips64/sgi-ip27/ip27-rtc.c trivial-2.5.6-pre3/arch/mips64/sgi-ip27/ip27-rtc.c
--- linux-2.5.6-pre3/arch/mips64/sgi-ip27/ip27-rtc.c Wed Feb 20 17:55:07 2002
+++ trivial-2.5.6-pre3/arch/mips64/sgi-ip27/ip27-rtc.c Thu Mar 7 18:20:32 2002
@@ -201,7 +201,8 @@
KL_CONFIG_CH_CONS_INFO(nid)->memory_base + IOC3_BYTEBUS_DEV0;

printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
- misc_register(&rtc_dev);
+ if (misc_register(&rtc_dev))
+ return -ENODEV;
create_proc_read_entry ("rtc", 0, NULL, rtc_read_proc, NULL);

save_flags(flags);
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.6-pre3/arch/ppc/iSeries/rtc.c trivial-2.5.6-pre3/arch/ppc/iSeries/rtc.c
--- linux-2.5.6-pre3/arch/ppc/iSeries/rtc.c Wed Feb 20 17:57:03 2002
+++ trivial-2.5.6-pre3/arch/ppc/iSeries/rtc.c Thu Mar 7 18:20:32 2002
@@ -192,7 +192,8 @@

static int __init rtc_init(void)
{
- misc_register(&rtc_dev);
+ if (misc_register(&rtc_dev))
+ return -ENODEV;
create_proc_read_entry ("driver/rtc", 0, 0, rtc_read_proc, NULL);

printk(KERN_INFO "iSeries Real Time Clock Driver v" RTC_VERSION "\n");
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.6-pre3/drivers/acorn/char/mouse_ps2.c trivial-2.5.6-pre3/drivers/acorn/char/mouse_ps2.c
--- linux-2.5.6-pre3/drivers/acorn/char/mouse_ps2.c Thu Mar 7 15:13:39 2002
+++ trivial-2.5.6-pre3/drivers/acorn/char/mouse_ps2.c Thu Mar 7 18:20:32 2002
@@ -271,7 +271,8 @@
iomd_writeb(0, IOMD_MSECTL);
iomd_writeb(8, IOMD_MSECTL);

- misc_register(&psaux_mouse);
+ if (misc_register(&psaux_mouse))
+ return -ENODEV;
queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
memset(queue, 0, sizeof(*queue));
queue->head = queue->tail = 0;
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.6-pre3/drivers/acorn/scsi/ecoscsi.c trivial-2.5.6-pre3/drivers/acorn/scsi/ecoscsi.c
--- linux-2.5.6-pre3/drivers/acorn/scsi/ecoscsi.c Wed Feb 20 17:55:23 2002
+++ trivial-2.5.6-pre3/drivers/acorn/scsi/ecoscsi.c Thu Mar 7 18:20:32 2002
@@ -125,7 +125,11 @@
}

NCR5380_init(instance, 0);
- request_region (instance->io_port, instance->n_io_port, "ecoscsi");
+ if (request_region (instance->io_port, instance->n_io_port, "ecoscsi") == NULL)
+ {
+ scsi_unregister(instance);
+ return 0;
+ }

if (instance->irq != IRQ_NONE)
if (request_irq(instance->irq, do_ecoscsi_intr, SA_INTERRUPT, "ecoscsi", NULL)) {
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.6-pre3/drivers/char/acquirewdt.c trivial-2.5.6-pre3/drivers/char/acquirewdt.c
--- linux-2.5.6-pre3/drivers/char/acquirewdt.c Wed Feb 20 17:55:23 2002
+++ trivial-2.5.6-pre3/drivers/char/acquirewdt.c Thu Mar 7 18:20:32 2002
@@ -207,7 +207,8 @@
printk("WDT driver for Acquire single board computer initialising.\n");

spin_lock_init(&acq_lock);
- misc_register(&acq_miscdev);
+ if (misc_register(&acq_miscdev))
+ return -ENODEV;
request_region(WDT_STOP, 1, "Acquire WDT");
request_region(WDT_START, 1, "Acquire WDT");
register_reboot_notifier(&acq_notifier);
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.6-pre3/drivers/isdn/act2000/act2000_isa.c trivial-2.5.6-pre3/drivers/isdn/act2000/act2000_isa.c
--- linux-2.5.6-pre3/drivers/isdn/act2000/act2000_isa.c Mon Oct 1 05:26:05 2001
+++ trivial-2.5.6-pre3/drivers/isdn/act2000/act2000_isa.c Thu Mar 7 18:20:33 2002
@@ -178,7 +178,8 @@
card->flags &= ~ACT2000_FLAGS_PVALID;
}
if (!check_region(portbase, ISA_REGION)) {
- request_region(portbase, ACT2000_PORTLEN, card->regname);
+ if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
+ return -EIO;
card->port = portbase;
card->flags |= ACT2000_FLAGS_PVALID;
return 0;

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.023 / U:1.300 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site