diff mbox

PM / devfreq: exynos-ppmu: fix error path in exynos_ppmu_probe()

Message ID 1467112869-30488-1-git-send-email-b.zolnierkie@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bartlomiej Zolnierkiewicz June 28, 2016, 11:21 a.m. UTC
iounmap() needs to be called in case of memory allocation
(for devfreq-event devices) failure.  Fix it.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/devfreq/event/exynos-ppmu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Chanwoo Choi June 28, 2016, 12:10 p.m. UTC | #1
2016-06-28 20:21 GMT+09:00 Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>:
> iounmap() needs to be called in case of memory allocation
> (for devfreq-event devices) failure.  Fix it.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>  drivers/devfreq/event/exynos-ppmu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
> index f312485..845bf25 100644
> --- a/drivers/devfreq/event/exynos-ppmu.c
> +++ b/drivers/devfreq/event/exynos-ppmu.c
> @@ -482,7 +482,8 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
>         if (!info->edev) {
>                 dev_err(&pdev->dev,
>                         "failed to allocate memory devfreq-event devices\n");
> -               return -ENOMEM;
> +               ret = -ENOMEM;
> +               goto err;
>         }
>         edev = info->edev;
>         platform_set_drvdata(pdev, info);
> --
> 1.9.1
>

Acked-by: Chanwoo Choi <cw00.choi@samsung.com>

Also, this patch fix the bug. So, this patch should be included in v4.7-rc.

Thanks,
Chanwoo Choi
diff mbox

Patch

diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
index f312485..845bf25 100644
--- a/drivers/devfreq/event/exynos-ppmu.c
+++ b/drivers/devfreq/event/exynos-ppmu.c
@@ -482,7 +482,8 @@  static int exynos_ppmu_probe(struct platform_device *pdev)
 	if (!info->edev) {
 		dev_err(&pdev->dev,
 			"failed to allocate memory devfreq-event devices\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err;
 	}
 	edev = info->edev;
 	platform_set_drvdata(pdev, info);