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] [day] [month] [year] [list]
Message-id: <alpine.LFD.2.00.0902192038480.5511@xanadu.home>
Date:	Thu, 19 Feb 2009 20:41:58 -0500 (EST)
From:	Nicolas Pitre <nico@....org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	drzeus-mmc@...eus.cx, lkml <linux-kernel@...r.kernel.org>,
	maen@...vell.com
Subject: Re: [PATCH v2] SDIO driver for Marvell SoCs

On Thu, 19 Feb 2009, Andrew Morton wrote:

> --- a/drivers/mmc/host/mvsdio.c~sdio-driver-for-marvell-socs-update
> +++ a/drivers/mmc/host/mvsdio.c
> @@ -783,9 +783,9 @@ out:
>  			gpio_free(host->gpio_write_protect);
>  		if (host->base)
>  			iounmap(host->base);
> -		if (host->res)
> -			release_resource(host->res);
>  	}
> +	if (r)
> +		release_resource(host->res);
>  	if (mmc)
>  		mmc_free_host(mmc);
>  
> _
> 
> Nope, this will deref a null pointer on that error path and wouldn't
> release the right thing anyway.

Obviously.  I'm just too stupid sometimes.  A s/host->res/r/ in both 
places would be better.

> Something like this...
> 
> --- a/drivers/mmc/host/mvsdio.c~sdio-driver-for-marvell-socs-update
> +++ a/drivers/mmc/host/mvsdio.c
> @@ -688,6 +688,7 @@ static int __init mvsd_probe(struct plat
>  
>  	mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
>  	if (!mmc) {
> +		release_resource(r);
>  		ret = -ENOMEM;
>  		goto out;
>  	}

That's fine too.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ