aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/DAC960.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-11-07 04:01:32 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:54:05 -0500
commit6044ec8882c726e325017bd948aa0cd94ad33abc (patch)
tree3bfc5dc93434e8ad556540f6689abcd2699aa45d /drivers/block/DAC960.c
parent2ea7533060e361810c21b2f5ee02151c4dfb85d8 (diff)
[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>
Diffstat (limited to 'drivers/block/DAC960.c')
-rw-r--r--drivers/block/DAC960.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 3760edfdc65c..70eaa5c7ac08 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -417,14 +417,12 @@ static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller)
417 * Remember the beginning of the group, but don't free it 417 * Remember the beginning of the group, but don't free it
418 * until we've reached the beginning of the next group. 418 * until we've reached the beginning of the next group.
419 */ 419 */
420 if (CommandGroup != NULL) 420 kfree(CommandGroup);
421 kfree(CommandGroup); 421 CommandGroup = Command;
422 CommandGroup = Command;
423 } 422 }
424 Controller->Commands[i] = NULL; 423 Controller->Commands[i] = NULL;
425 } 424 }
426 if (CommandGroup != NULL) 425 kfree(CommandGroup);
427 kfree(CommandGroup);
428 426
429 if (Controller->CombinedStatusBuffer != NULL) 427 if (Controller->CombinedStatusBuffer != NULL)
430 { 428 {
@@ -435,30 +433,23 @@ static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller)
435 433
436 if (ScatterGatherPool != NULL) 434 if (ScatterGatherPool != NULL)
437 pci_pool_destroy(ScatterGatherPool); 435 pci_pool_destroy(ScatterGatherPool);
438 if (Controller->FirmwareType == DAC960_V1_Controller) return; 436 if (Controller->FirmwareType == DAC960_V1_Controller)
437 return;
439 438
440 if (RequestSensePool != NULL) 439 if (RequestSensePool != NULL)
441 pci_pool_destroy(RequestSensePool); 440 pci_pool_destroy(RequestSensePool);
442 441
443 for (i = 0; i < DAC960_MaxLogicalDrives; i++) 442 for (i = 0; i < DAC960_MaxLogicalDrives; i++) {
444 if (Controller->V2.LogicalDeviceInformation[i] != NULL)
445 {
446 kfree(Controller->V2.LogicalDeviceInformation[i]); 443 kfree(Controller->V2.LogicalDeviceInformation[i]);
447 Controller->V2.LogicalDeviceInformation[i] = NULL; 444 Controller->V2.LogicalDeviceInformation[i] = NULL;
448 } 445 }
449 446
450 for (i = 0; i < DAC960_V2_MaxPhysicalDevices; i++) 447 for (i = 0; i < DAC960_V2_MaxPhysicalDevices; i++)
451 { 448 {
452 if (Controller->V2.PhysicalDeviceInformation[i] != NULL) 449 kfree(Controller->V2.PhysicalDeviceInformation[i]);
453 { 450 Controller->V2.PhysicalDeviceInformation[i] = NULL;
454 kfree(Controller->V2.PhysicalDeviceInformation[i]); 451 kfree(Controller->V2.InquiryUnitSerialNumber[i]);
455 Controller->V2.PhysicalDeviceInformation[i] = NULL; 452 Controller->V2.InquiryUnitSerialNumber[i] = NULL;
456 }
457 if (Controller->V2.InquiryUnitSerialNumber[i] != NULL)
458 {
459 kfree(Controller->V2.InquiryUnitSerialNumber[i]);
460 Controller->V2.InquiryUnitSerialNumber[i] = NULL;
461 }
462 } 453 }
463} 454}
464 455