Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432879 > unrolled thread

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

Started byBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
First post2016-06-28 13:30 +0200
Last post2016-06-28 14:20 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] PM / devfreq: exynos-ppmu: fix error path in  exynos_ppmu_probe() Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2016-06-28 13:30 +0200
    [PATCH] PM / devfreq: exynos: fix error path in exynos_bus_probe() Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2016-06-28 13:30 +0200
      Re: [PATCH] PM / devfreq: exynos: fix error path in exynos_bus_probe() Chanwoo Choi <cwchoi00@gmail.com> - 2016-06-28 14:10 +0200
    Re: [PATCH] PM / devfreq: exynos-ppmu: fix error path in exynos_ppmu_probe() Chanwoo Choi <cwchoi00@gmail.com> - 2016-06-28 14:20 +0200

#1432879 — [PATCH] PM / devfreq: exynos-ppmu: fix error path in exynos_ppmu_probe()

FromBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Date2016-06-28 13:30 +0200
Subject[PATCH] PM / devfreq: exynos-ppmu: fix error path in exynos_ppmu_probe()
Message-ID<rOZnk-6lK-23@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1432885 — [PATCH] PM / devfreq: exynos: fix error path in exynos_bus_probe()

FromBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Date2016-06-28 13:30 +0200
Subject[PATCH] PM / devfreq: exynos: fix error path in exynos_bus_probe()
Message-ID<rOZnl-6lK-51@gated-at.bofh.it>
In reply to#1432879
In case of exynos_bus_parse_of() failure the code shouldn't
try to remove the OPP table and disable+unprepare bus->clk
as it has been already handled in exynos_bus_parse_of().

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

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 2363d0a..e946f8f 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -407,7 +407,7 @@ static int exynos_bus_probe(struct platform_device *pdev)
 	/* Parse the device-tree to get the resource information */
 	ret = exynos_bus_parse_of(np, bus);
 	if (ret < 0)
-		goto err;
+		return ret;
 
 	profile = devm_kzalloc(dev, sizeof(*profile), GFP_KERNEL);
 	if (!profile) {
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1432921 — Re: [PATCH] PM / devfreq: exynos: fix error path in exynos_bus_probe()

FromChanwoo Choi <cwchoi00@gmail.com>
Date2016-06-28 14:10 +0200
SubjectRe: [PATCH] PM / devfreq: exynos: fix error path in exynos_bus_probe()
Message-ID<rP001-6Rk-9@gated-at.bofh.it>
In reply to#1432885
2016-06-28 20:21 GMT+09:00 Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>:
> In case of exynos_bus_parse_of() failure the code shouldn't
> try to remove the OPP table and disable+unprepare bus->clk
> as it has been already handled in exynos_bus_parse_of().
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>  drivers/devfreq/exynos-bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index 2363d0a..e946f8f 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -407,7 +407,7 @@ static int exynos_bus_probe(struct platform_device *pdev)
>         /* Parse the device-tree to get the resource information */
>         ret = exynos_bus_parse_of(np, bus);
>         if (ret < 0)
> -               goto err;
> +               return ret;
>
>         profile = devm_kzalloc(dev, sizeof(*profile), GFP_KERNEL);
>         if (!profile) {
> --
> 1.9.1

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

And, this patch fixes the bug. It should be included in v4.7-rc version.

Thanks,
Chanwoo Choi

[toc] | [prev] | [next] | [standalone]


#1432926 — Re: [PATCH] PM / devfreq: exynos-ppmu: fix error path in exynos_ppmu_probe()

FromChanwoo Choi <cwchoi00@gmail.com>
Date2016-06-28 14:20 +0200
SubjectRe: [PATCH] PM / devfreq: exynos-ppmu: fix error path in exynos_ppmu_probe()
Message-ID<rP09H-6V8-11@gated-at.bofh.it>
In reply to#1432879
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web