diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/DAC960.c | 31 | ||||
-rw-r--r-- | drivers/block/cciss.c | 12 |
2 files changed, 15 insertions, 28 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 | ||
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 486b6e1c7dfb..a97c80b57737 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1096,14 +1096,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, | |||
1096 | cleanup1: | 1096 | cleanup1: |
1097 | if (buff) { | 1097 | if (buff) { |
1098 | for(i=0; i<sg_used; i++) | 1098 | for(i=0; i<sg_used; i++) |
1099 | if(buff[i] != NULL) | 1099 | kfree(buff[i]); |
1100 | kfree(buff[i]); | ||
1101 | kfree(buff); | 1100 | kfree(buff); |
1102 | } | 1101 | } |
1103 | if (buff_size) | 1102 | kfree(buff_size); |
1104 | kfree(buff_size); | 1103 | kfree(ioc); |
1105 | if (ioc) | ||
1106 | kfree(ioc); | ||
1107 | return(status); | 1104 | return(status); |
1108 | } | 1105 | } |
1109 | default: | 1106 | default: |
@@ -3034,8 +3031,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
3034 | return(1); | 3031 | return(1); |
3035 | 3032 | ||
3036 | clean4: | 3033 | clean4: |
3037 | if(hba[i]->cmd_pool_bits) | 3034 | kfree(hba[i]->cmd_pool_bits); |
3038 | kfree(hba[i]->cmd_pool_bits); | ||
3039 | if(hba[i]->cmd_pool) | 3035 | if(hba[i]->cmd_pool) |
3040 | pci_free_consistent(hba[i]->pdev, | 3036 | pci_free_consistent(hba[i]->pdev, |
3041 | NR_CMDS * sizeof(CommandList_struct), | 3037 | NR_CMDS * sizeof(CommandList_struct), |