All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tehuti: possible leak in bdx_probe
@ 2007-10-13 17:03 Florin Malita
  2007-10-14  8:30 ` Alexander Indenbaum
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Florin Malita @ 2007-10-13 17:03 UTC (permalink / raw)
  To: baum, andy; +Cc: Andrew Morton, netdev

If pci_enable_device fails, bdx_probe returns without freeing the 
allocated pci_nic structure.

Coverity CID 1908.

Signed-off-by: Florin Malita <fmalita@gmail.com>
---

 drivers/net/tehuti.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 8d04654..4e1b84e 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -1906,7 +1906,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
     /************** pci *****************/
 	if ((err = pci_enable_device(pdev)))	/* it trigers interrupt, dunno why. */
-		RET(err);			/* it's not a problem though */
+		goto err_pci;			/* it's not a problem though */
 
 	if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) &&
 	    !(err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))) {
@@ -2076,6 +2076,7 @@ err_out_res:
 	pci_release_regions(pdev);
 err_dma:
 	pci_disable_device(pdev);
+err_pci:
 	vfree(nic);
 
 	RET(err);


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-10-15 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-13 17:03 [PATCH] tehuti: possible leak in bdx_probe Florin Malita
2007-10-14  8:30 ` Alexander Indenbaum
2007-10-15 13:33 ` Andy Gospodarek
2007-10-15 18:34 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.