aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/DAC960.c
diff options
context:
space:
mode:
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