mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
[PATCH] bogus kfree() in ibmtr
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> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
433992361c
commit
25e2d79f52
1 changed files with 0 additions and 5 deletions
|
@ -531,7 +531,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
|
||||||
if (!time_after(jiffies, timeout)) continue;
|
if (!time_after(jiffies, timeout)) continue;
|
||||||
DPRINTK( "Hardware timeout during initialization.\n");
|
DPRINTK( "Hardware timeout during initialization.\n");
|
||||||
iounmap(t_mmio);
|
iounmap(t_mmio);
|
||||||
kfree(ti);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
ti->sram_phys =
|
ti->sram_phys =
|
||||||
|
@ -645,7 +644,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
|
||||||
DPRINTK("Unknown shared ram paging info %01X\n",
|
DPRINTK("Unknown shared ram paging info %01X\n",
|
||||||
ti->shared_ram_paging);
|
ti->shared_ram_paging);
|
||||||
iounmap(t_mmio);
|
iounmap(t_mmio);
|
||||||
kfree(ti);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
break;
|
break;
|
||||||
} /*end switch shared_ram_paging */
|
} /*end switch shared_ram_paging */
|
||||||
|
@ -675,7 +673,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
|
||||||
"driver limit (%05x), adapter not started.\n",
|
"driver limit (%05x), adapter not started.\n",
|
||||||
chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE);
|
chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE);
|
||||||
iounmap(t_mmio);
|
iounmap(t_mmio);
|
||||||
kfree(ti);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
} else { /* seems cool, record what we have figured out */
|
} else { /* seems cool, record what we have figured out */
|
||||||
ti->sram_base = new_base >> 12;
|
ti->sram_base = new_base >> 12;
|
||||||
|
@ -690,7 +687,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
|
||||||
DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n",
|
DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n",
|
||||||
irq);
|
irq);
|
||||||
iounmap(t_mmio);
|
iounmap(t_mmio);
|
||||||
kfree(ti);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
/*?? Now, allocate some of the PIO PORTs for this driver.. */
|
/*?? Now, allocate some of the PIO PORTs for this driver.. */
|
||||||
|
@ -699,7 +695,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
|
||||||
DPRINTK("Could not grab PIO range. Halting driver.\n");
|
DPRINTK("Could not grab PIO range. Halting driver.\n");
|
||||||
free_irq(dev->irq, dev);
|
free_irq(dev->irq, dev);
|
||||||
iounmap(t_mmio);
|
iounmap(t_mmio);
|
||||||
kfree(ti);
|
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue