* [KJ] [PATCH 2] drivers/char/mxser.c: check return value of
@ 2006-07-04 11:24 Richard
0 siblings, 0 replies; only message in thread
From: Richard @ 2006-07-04 11:24 UTC (permalink / raw)
To: kernel-janitors
Signed-off-by: Richard van Berkum <h.vanberkum at chello.nl>
--- janitor-2.6/drivers/char/mxser.c 2006-07-01 11:54:45.895077096 +0200
+++ mytree/drivers/char/mxser.c 2006-07-04 15:29:51.039526600 +0200
@@ -3127,8 +3139,17 @@ static int mxser_get_ISA_conf(int cap, s
hwconf->ports = 8;
else
hwconf->ports = 4;
- request_region(hwconf->ioaddr[0], 8 * hwconf->ports, "mxser(IO)");
- request_region(hwconf->vector, 1, "mxser(vector)");
+ if (!(request_region(hwconf->ioaddr[0], 8 * hwconf->ports, "mxser(IO)"))) {
+ printk(KERN_ERR "mxser: I/O ports already in use\n");
+ return -EIO;
+ }
+
+ if (!(request_region(hwconf->vector, 1, "mxser(vector)"))) {
+ printk(KERN_ERR "mxser: I/O ports already in use\n");
+ release_region(hwconf->ioaddr[0], 8 * hwconf->ports);
+ return -EIO;
+ }
+
return hwconf->ports;
}
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-07-04 11:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-04 11:24 [KJ] [PATCH 2] drivers/char/mxser.c: check return value of Richard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.