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]
Date:	Sat, 13 Oct 2012 16:01:14 +0900
From:	Jaehoon Chung <jh80.chung@...sung.com>
To:	Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
Cc:	linux-kernel@...r.kernel.org, Chris Ball <cjb@...top.org>,
	linux-mmc@...r.kernel.org
Subject: Re: [PATCH] sdhci: put regulator if probe fails

On 10/13/2012 09:55 AM, Thadeu Lima de Souza Cascardo wrote:
> When using the dummy regulator, SDHCI may fail its probing because the
> regulator does not support any voltages.
> 
> When reloading the driver, you will get a warning about a duplicate
> sysfs link.
> 
> [72211.963386] 0000:03:00.0 supply vmmc not found, using dummy regulator
> [72211.963409] ------------[ cut here ]------------
> [72211.963420] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x99/0xad()
> [72211.963424] Hardware name:
> [72211.963429] sysfs: cannot create duplicate filename '/devices/platform/reg-dummy/regulator/regulator.0/0000:03:00.0-vmmc'
> 
> Avoid this by properly cleaning up when the probe fails calling
> regulator_put. Other fail paths get fixed as well.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
> ---
>  drivers/mmc/host/sdhci.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 7922adb..dd6bc26 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2992,7 +2992,8 @@ int sdhci_add_host(struct sdhci_host *host)
>  	if (mmc->ocr_avail == 0) {
>  		pr_err("%s: Hardware doesn't report any "
>  			"support voltages.\n", mmc_hostname(mmc));
> -		return -ENODEV;
> +		ret = -ENODEV;
> +		goto out_vmmc;
>  	}
>  
>  	spin_lock_init(&host->lock);
> @@ -3121,6 +3122,9 @@ reset:
>  untasklet:
>  	tasklet_kill(&host->card_tasklet);
>  	tasklet_kill(&host->finish_tasklet);
> +out_vmmc:
> +	if (host->vmmc)
> +		regulator_put(host->vmmc);
If fall down to untasklet, need not to disable regulator for vmmc?

Best Regards,
Jaehoon Chung
>  
>  	return ret;
>  }
> 

--
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