Skip to contentSkip to conversation

release_region in cciss block driver

PATCH In review Felipe W Damasio 3 participants 4 messages Oct 6, 2003 – Oct 13, 2003 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 release_region in cciss block driver

	Hi Andrew,

	Patch against 2.6.0-test6.

	Release a previous requested region if we're about the fail the board 

initialization. Found by smatch.

Please review and consider applying,

Thanks.

Felipe

drivers/block/cciss.c renamed from drivers/block/cciss.c.orig +1 -0
@@ -2185,6 +2185,7 @@
 		schedule_timeout(HZ / 10); /* wait 100ms */
 	}
 	if (scratchpad != CCISS_FIRMWARE_READY) {
+		release_io_mem (c);
 		printk(KERN_WARNING "cciss: Board not ready.  Timed out.\n");
 		return -1;
 	}
#1 lore raw
Quoted 16 lines · Felipe W Damasio

Hi Andrew,

Patch against 2.6.0-test6.

Release a previous requested region if we're about the fail the board initialization. Found by smatch.

Please review and consider applying,

Thanks.

Felipe

drivers/block/cciss.c line 2191

Quoted 7 lines
drivers/block/cciss.c renamed from drivers/block/cciss.c.orig +1 -0
@@ -2185,6 +2185,7 @@
 		schedule_timeout(HZ / 10); /* wait 100ms */
 	}
 	if (scratchpad != CCISS_FIRMWARE_READY) {
+		release_io_mem (c);
 		printk(KERN_WARNING "cciss: Board not ready.  Timed out.\n");
 		return -1;
 	}

Please at least try and follow the local style when you make changes.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 1 line · Jens Axboe

Please at least try and follow the local style when you make changes.

Right, sorry.

Andrew, please use this patch instead.

Felipe

drivers/block/cciss.c renamed from drivers/block/cciss.c.orig +1 -0
@@ -2185,6 +2185,7 @@
 		schedule_timeout(HZ / 10); /* wait 100ms */
 	}
 	if (scratchpad != CCISS_FIRMWARE_READY) {
+		release_io_mem(c);
 		printk(KERN_WARNING "cciss: Board not ready.  Timed out.\n");
 		return -1;
 	}
#3 lore raw
Quoted 11 lines · Felipe W Damasio

--- linux-2.6.0-test6/drivers/block/cciss.c.orig 2003-10-06 10:18:01.000000000 -0300
+++ linux-2.6.0-test6/drivers/block/cciss.c 2003-10-06 10:25:04.000000000 -0300
@@ -2185,6 +2185,7 @@
schedule_timeout(HZ / 10); /* wait 100ms */
}
if (scratchpad != CCISS_FIRMWARE_READY) {
+ release_io_mem(c);
printk(KERN_WARNING "cciss: Board not ready. Timed out.\n"); return -1;
}

It seems to me that the driver is already performing this function in the caller.

static int __devinit cciss_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)

{
	...
	if (cciss_pci_init(hba[i], pdev) != 0)
		goto clean1;
	...
clean1:
	release_io_mem(hba[i]);
	free_hba(i);
	return(-1);
}