mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bogus kfree() in ibmtr
@ 2005-10-04 16:40 Al Viro
  0 siblings, 0 replies; only message in thread
From: Al Viro @ 2005-10-04 16:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Jeff Garzik, linux-kernel

	On several failure exits in ibmtr we end up doing kfree() on
dev->priv, with dev allocated by alloc_trdev() and ->priv never reassigned.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
----
diff -urN RC14-rc3-git4-base/drivers/net/tokenring/ibmtr.c current/drivers/net/tokenring/ibmtr.c
--- RC14-rc3-git4-base/drivers/net/tokenring/ibmtr.c	2005-08-28 23:09:44.000000000 -0400
+++ current/drivers/net/tokenring/ibmtr.c	2005-10-03 18:15:27.000000000 -0400
@@ -531,7 +531,6 @@
 			if (!time_after(jiffies, timeout)) continue;
 			DPRINTK( "Hardware timeout during initialization.\n");
 			iounmap(t_mmio);
-			kfree(ti);
 			return -ENODEV;
 		}
 		ti->sram_phys =
@@ -645,7 +644,6 @@
 			DPRINTK("Unknown shared ram paging info %01X\n",
 							ti->shared_ram_paging);
 			iounmap(t_mmio); 
-			kfree(ti);
 			return -ENODEV;
 			break;
 		} /*end switch shared_ram_paging */
@@ -675,7 +673,6 @@
 			"driver limit (%05x), adapter not started.\n",
 			chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE);
 			iounmap(t_mmio);
-			kfree(ti);
 			return -ENODEV;
 		} else { /* seems cool, record what we have figured out */
 			ti->sram_base = new_base >> 12;
@@ -690,7 +687,6 @@
 		DPRINTK("Could not grab irq %d.  Halting Token Ring driver.\n",
 					irq);
 		iounmap(t_mmio);
-		kfree(ti);
 		return -ENODEV;
 	}
 	/*?? Now, allocate some of the PIO PORTs for this driver.. */
@@ -699,7 +695,6 @@
 		DPRINTK("Could not grab PIO range. Halting driver.\n");
 		free_irq(dev->irq, dev);
 		iounmap(t_mmio);
-		kfree(ti);
 		return -EBUSY;
 	}
 

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

only message in thread, other threads:[~2005-10-04 16:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-04 16:40 [PATCH] bogus kfree() in ibmtr Al Viro

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

Powered by JetHome