Skip to contentSkip to conversation

Also iounmap when kzalloc fails in tioca_bus_fixup (ia64/sn/pci/tioca_provider.c)

PATCH In review Roel Kluin 2 participants 2 messages Nov 3, 2007 – Nov 5, 2007

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Also iounmap when kzalloc fails in tioca_bus_fixup (ia64/sn/pci/tioca_provider.c)

Also iounmap when kzalloc fails

---

arch/ia64/sn/pci/tioca_provider.c +2 -0
index ef048a6..de1ec5c 100644
@@ -618,6 +618,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
 
 	tioca_kern = kzalloc(sizeof(struct tioca_kernel), GFP_KERNEL);
 	if (!tioca_kern) {
+		iounmap(tioca_common->ca_common.bs_base);
 		kfree(tioca_common);
 		return NULL;
 	}
@@ -637,6 +638,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
 	/* init GART */
 
 	if (tioca_gart_init(tioca_kern) < 0) {
+		iounmap(tioca_common->ca_common.bs_base);
 		kfree(tioca_kern);
 		kfree(tioca_common);
 		return NULL;
#1 lore raw
Quoted 1 line · Roel Kluin

Also iounmap when kzalloc fails

This looks correct to me, so long as calling iounmap() actually reverses ioremap() in this case.

Quoted 26 lines

---

arch/ia64/sn/pci/tioca_provider.c +2 -1
index ef048a6..de1ec5c 100644
@@ -618,6 +618,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
 
 	tioca_kern = kzalloc(sizeof(struct tioca_kernel), GFP_KERNEL);
 	if (!tioca_kern) {
+		iounmap(tioca_common->ca_common.bs_base);
 		kfree(tioca_common);
 		return NULL;
 	}
@@ -637,6 +638,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
 	/* init GART */
 
 	if (tioca_gart_init(tioca_kern) < 0) {
+		iounmap(tioca_common->ca_common.bs_base);
 		kfree(tioca_kern);
 		kfree(tioca_common);
 		return NULL;
-

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/