From 6044ec8882c726e325017bd948aa0cd94ad33abc Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 7 Nov 2005 01:01:32 -0800 Subject: [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 Acked-by: Aristeu Sergio Rozanski Filho Acked-by: Roland Dreier Acked-by: Pierre Ossman Acked-by: Jean Delvare Acked-by: Greg Kroah-Hartman Acked-by: Len Brown Acked-by: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/block/DAC960.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'drivers/block/DAC960.c') diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 3760edfdc65..70eaa5c7ac0 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -417,14 +417,12 @@ static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller) * Remember the beginning of the group, but don't free it * until we've reached the beginning of the next group. */ - if (CommandGroup != NULL) - kfree(CommandGroup); - CommandGroup = Command; + kfree(CommandGroup); + CommandGroup = Command; } Controller->Commands[i] = NULL; } - if (CommandGroup != NULL) - kfree(CommandGroup); + kfree(CommandGroup); if (Controller->CombinedStatusBuffer != NULL) { @@ -435,30 +433,23 @@ static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller) if (ScatterGatherPool != NULL) pci_pool_destroy(ScatterGatherPool); - if (Controller->FirmwareType == DAC960_V1_Controller) return; + if (Controller->FirmwareType == DAC960_V1_Controller) + return; if (RequestSensePool != NULL) pci_pool_destroy(RequestSensePool); - for (i = 0; i < DAC960_MaxLogicalDrives; i++) - if (Controller->V2.LogicalDeviceInformation[i] != NULL) - { + for (i = 0; i < DAC960_MaxLogicalDrives; i++) { kfree(Controller->V2.LogicalDeviceInformation[i]); Controller->V2.LogicalDeviceInformation[i] = NULL; - } + } for (i = 0; i < DAC960_V2_MaxPhysicalDevices; i++) { - if (Controller->V2.PhysicalDeviceInformation[i] != NULL) - { - kfree(Controller->V2.PhysicalDeviceInformation[i]); - Controller->V2.PhysicalDeviceInformation[i] = NULL; - } - if (Controller->V2.InquiryUnitSerialNumber[i] != NULL) - { - kfree(Controller->V2.InquiryUnitSerialNumber[i]); - Controller->V2.InquiryUnitSerialNumber[i] = NULL; - } + kfree(Controller->V2.PhysicalDeviceInformation[i]); + Controller->V2.PhysicalDeviceInformation[i] = NULL; + kfree(Controller->V2.InquiryUnitSerialNumber[i]); + Controller->V2.InquiryUnitSerialNumber[i] = NULL; } } -- cgit v1.2.3