lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 15 Oct 2007 09:33:09 -0400
From:	Andy Gospodarek <andy@...yhouse.net>
To:	Florin Malita <fmalita@...il.com>
Cc:	baum@...utinetworks.net, andy@...yhouse.net,
	Andrew Morton <akpm@...ux-foundation.org>,
	netdev@...r.kernel.org
Subject: Re: [PATCH] tehuti: possible leak in bdx_probe

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@...il.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@...yhouse.net>

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ