All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Gospodarek <andy@greyhouse.net>
To: Florin Malita <fmalita@gmail.com>
Cc: baum@tehutinetworks.net, andy@greyhouse.net,
	Andrew Morton <akpm@linux-foundation.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] tehuti: possible leak in bdx_probe
Date: Mon, 15 Oct 2007 09:33:09 -0400	[thread overview]
Message-ID: <20071015133309.GI9140@gospo.rdu.redhat.com> (raw)
In-Reply-To: <4710FA6A.2070902@gmail.com>

On Sat, Oct 13, 2007 at 01:03:38PM -0400, Florin Malita wrote:
> 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);
> 

Good catch.  Thanks!

Acked-by: Andy Gospodarek <andy@greyhouse.net>


  parent reply	other threads:[~2007-10-15 13:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2007-10-15 18:34 ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071015133309.GI9140@gospo.rdu.redhat.com \
    --to=andy@greyhouse.net \
    --cc=akpm@linux-foundation.org \
    --cc=baum@tehutinetworks.net \
    --cc=fmalita@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.