public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] drivers/block/DAC960.c: fix a use after free
@ 2005-03-24  1:14 Adrian Bunk
  0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2005-03-24  1:14 UTC (permalink / raw)
  To: dmo; +Cc: linux-kernel

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.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.12-rc1-mm1-full/drivers/block/DAC960.c.old	2005-03-23 03:35:40.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/drivers/block/DAC960.c	2005-03-23 03:38:10.000000000 +0100
@@ -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)
   {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-24  1:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-24  1:14 [2.6 patch] drivers/block/DAC960.c: fix a use after free Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox