You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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>
This commit is contained in:
committed by
Linus Torvalds
parent
2ea7533060
commit
6044ec8882
+11
-20
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user