Also iounmap when kzalloc fails in tioca_bus_fixup (ia64/sn/pci/tioca_provider.c)
PATCH 1/1 Also iounmap when kzalloc fails in tioca_bus_fixup (ia64/sn/pci/tioca_provider.c)
Also iounmap when kzalloc fails
Signed-off-by Roel Kluin <[email protected]>
---
arch/ia64/sn/pci/tioca_provider.c +2 -0
@@ -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 ;
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
Signed-off-by Roel Kluin <[email protected]>---
arch/ia64/sn/pci/tioca_provider.c +2
-1@@ -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/