提交 6b7a783e 编写于 作者: N NeilBrown 提交者: Ulf Hansson

mmc: pwrseq_simple: fix error path in mmc_pwrseq_simple_alloc

The current error-path code (when gpiod_get_index() reports
an error) can never free pwrseq->reset_gpios[0], but might
try to tree pwrseq->reset_gpios[-1], which has unfortunate
consequences.
Signed-off-by: NNeilBrown <neil@brown.name>
Fixes: 934f1f48Acked-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Reported-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
上级 06e5801b
...@@ -124,7 +124,7 @@ int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev) ...@@ -124,7 +124,7 @@ int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev)
PTR_ERR(pwrseq->reset_gpios[i]) != -ENOSYS) { PTR_ERR(pwrseq->reset_gpios[i]) != -ENOSYS) {
ret = PTR_ERR(pwrseq->reset_gpios[i]); ret = PTR_ERR(pwrseq->reset_gpios[i]);
while (--i) while (i--)
gpiod_put(pwrseq->reset_gpios[i]); gpiod_put(pwrseq->reset_gpios[i]);
goto clk_put; goto clk_put;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册