[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 <[email protected]>
Acked-by: Aristeu Sergio Rozanski Filho <[email protected]>
Acked-by: Roland Dreier <[email protected]>
Acked-by: Pierre Ossman <[email protected]>
Acked-by: Jean Delvare <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Len Brown <[email protected]>
Acked-by: "Antonino A. Daplas" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Jesper Juhl 2005-11-07 01:01:32 -08:00 • committed by Linus Torvalds
commit 6044ec8882
24 changed files with 83 additions and 151 deletions

View file

@ -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;
}
}

View file

@ -1096,14 +1096,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
cleanup1:
if (buff) {
for(i=0; i<sg_used; i++)
if(buff[i] != NULL)
kfree(buff[i]);
kfree(buff[i]);
kfree(buff);
}
if (buff_size)
kfree(buff_size);
if (ioc)
kfree(ioc);
kfree(buff_size);
kfree(ioc);
return(status);
}
default:
@ -3034,8 +3031,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
return(1);
clean4:
if(hba[i]->cmd_pool_bits)
kfree(hba[i]->cmd_pool_bits);
kfree(hba[i]->cmd_pool_bits);
if(hba[i]->cmd_pool)
pci_free_consistent(hba[i]->pdev,
NR_CMDS * sizeof(CommandList_struct),