Skip to contentSkip to conversation

16) request_region check, 11-20

TRIVIAL Rusty Trivial Russell 2 participants 2 messages Jun 23, 2003 – Jun 27, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

(Included in 2.5)
From: [email protected]

here is one more trivial check.

So please test and apply.

Evgeniy Polyakov ( s0mbre )

drivers/acorn/scsi/oak.c renamed from drivers/acorn/scsi/oak.c.orig +2 -1
@@ -134,7 +134,8 @@
 	ecard_claim(ecs[count]);
 
 	instance->n_io_port = 255;
-	request_region (instance->io_port, instance->n_io_port, "Oak SCSI");
+	if (!request_region (instance->io_port, instance->n_io_port, "Oak SCSI"))
+		break;
 
 	if (instance->irq != IRQ_NONE)
 	    if (request_irq(instance->irq, do_oakscsi_intr, SA_INTERRUPT, "Oak SCSI", NULL)) {
Signature · 3 lines
  What is this? http://www.kernel.org/pub/linux/kernel/people/rusty/trivial/
  Don't blame me: the Monkey is driving
  File: [email protected]: 16) request_region check, 11-20
#1 lore raw

drivers/acorn/scsi/oak.c line 139

Quoted 10 lines · Rusty Trivial Russell
drivers/acorn/scsi/oak.c renamed from drivers/acorn/scsi/oak.c.orig +2 -1
@@ -134,7 +134,8 @@
 	ecard_claim(ecs[count]);
 
 	instance->n_io_port = 255;
-	request_region (instance->io_port, instance->n_io_port, "Oak SCSI");
+	if (!request_region (instance->io_port, instance->n_io_port, "Oak SCSI"))
+		break;
 

Doesn't clean up the register etc - so clearly wrong. Actually I suspect what needs doing is to request_region first, then register then _check_ the scsi_register return (it doesnt) and unregister the region.