[PATCH] kfree cleanup: misc remaining drivers

This is the remaining misc drivers/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in misc files in
drivers/.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
Acked-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Len Brown <len.brown@intel.com>
Acked-by: "Antonino A. Daplas" <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jesper Juhl
2005-11-07 01:01:32 -08:00
committed by Linus Torvalds
parent 2ea7533060
commit 6044ec8882
24 changed files with 83 additions and 151 deletions

View File

@@ -259,8 +259,7 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num
sizeof(struct irq_routing_table)) / sizeof(struct irq_info);
// Make sure I got at least one entry
if (len == 0) {
if (PCIIRQRoutingInfoLength != NULL)
kfree(PCIIRQRoutingInfoLength );
kfree(PCIIRQRoutingInfoLength );
return -1;
}
@@ -275,8 +274,7 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num
ctrl->pci_bus->number = tbus;
pci_bus_read_config_dword (ctrl->pci_bus, *dev_num, PCI_VENDOR_ID, &work);
if (!nobridge || (work == 0xffffffff)) {
if (PCIIRQRoutingInfoLength != NULL)
kfree(PCIIRQRoutingInfoLength );
kfree(PCIIRQRoutingInfoLength );
return 0;
}
@@ -289,20 +287,17 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num
dbg("Scan bus for Non Bridge: bus %d\n", tbus);
if (PCI_ScanBusForNonBridge(ctrl, tbus, dev_num) == 0) {
*bus_num = tbus;
if (PCIIRQRoutingInfoLength != NULL)
kfree(PCIIRQRoutingInfoLength );
kfree(PCIIRQRoutingInfoLength );
return 0;
}
} else {
if (PCIIRQRoutingInfoLength != NULL)
kfree(PCIIRQRoutingInfoLength );
kfree(PCIIRQRoutingInfoLength );
return 0;
}
}
}
if (PCIIRQRoutingInfoLength != NULL)
kfree(PCIIRQRoutingInfoLength );
kfree(PCIIRQRoutingInfoLength );
return -1;
}