Skip to contentSkip to conversation

drivers/block/DAC960.c: fix a use after free

PATCH New Adrian Bunk 1 participant 1 message Mar 24, 2005 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/block/DAC960.c: fix a use after free

This patch fixes a use after free found by the Coverity checker.

Controller is used in the Failure path.

In the Failure patch, Controller will be freed in the end, so this kfree can simply be deleted.

drivers/block/DAC960.c renamed from drivers/block/DAC960.c.old +1 -3
@@ -2700,10 +2700,8 @@
   Controller->PCIDevice = PCI_Device;
   strcpy(Controller->FullModelName, "DAC960");
 
-  if (pci_enable_device(PCI_Device))  {
-        kfree(Controller);
+  if (pci_enable_device(PCI_Device))
 	goto Failure;
-  }
 
   switch (Controller->HardwareType)
   {