提交 0e1746ac 编写于 作者: S Suniel Mahesh 提交者: Jaehoon Chung

drivers: mmc: Avoid memory leak in case of failure

priv pointer should be freed before returning with an error value
from exynos_dwmci_get_config().
Signed-off-by: NSuniel Mahesh <sunil.m@techveda.org>
Signed-off-by: NRaghu Bharadwaj <raghu@techveda.org>
上级 18e7c8f6
......@@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
if (host->dev_index > 4) {
printf("DWMMC%d: Can't get the dev index\n", host->dev_index);
free(priv);
return -EINVAL;
}
......@@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
base = fdtdec_get_addr(blob, node, "reg");
if (!base) {
printf("DWMMC%d: Can't get base address\n", host->dev_index);
free(priv);
return -EINVAL;
}
host->ioaddr = (void *)base;
......@@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
if (err) {
printf("DWMMC%d: Can't get sdr-timings for devider\n",
host->dev_index);
free(priv);
return -EINVAL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册