2012-11-21 05:12:27

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 1/2] PM/devfreq: Fix incorrect argument in error message

'g' is cast to the error return code. Hence gives the following error
which is fixed by this patch.

drivers/devfreq/devfreq.c:645 devfreq_remove_governor() error:
'g' dereferencing possible ERR_PTR()

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/devfreq/devfreq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 45e053e..83c2129 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -643,7 +643,7 @@ int devfreq_remove_governor(struct devfreq_governor *governor)
g = find_devfreq_governor(governor->name);
if (IS_ERR(g)) {
pr_err("%s: governor %s not registered\n", __func__,
- g->name);
+ governor->name);
err = -EINVAL;
goto err_out;
}
--
1.7.4.1


2012-11-21 05:12:32

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 2/2] PM/devfreq: Fix return value in devfreq_remove_governor()

Use the value obtained from the function instead of -EINVAL.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/devfreq/devfreq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 83c2129..2bd9ab0 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -644,7 +644,7 @@ int devfreq_remove_governor(struct devfreq_governor *governor)
if (IS_ERR(g)) {
pr_err("%s: governor %s not registered\n", __func__,
governor->name);
- err = -EINVAL;
+ err = PTR_ERR(g);
goto err_out;
}
list_for_each_entry(devfreq, &devfreq_list, node) {
--
1.7.4.1

2012-11-21 10:18:48

by MyungJoo Ham

[permalink] [raw]
Subject: Re: [PATCH 2/2] PM/devfreq: Fix return value in devfreq_remove_governor()

> Use the value obtained from the function instead of -EINVAL.
>
> Signed-off-by: Sachin Kamat <[email protected]>

Acked-by: MyungJoo Ham <[email protected]>

Both patches applied as they are obvious bugfixes.
I'll send pull request with other bugfixes within days.

> ---
> drivers/devfreq/devfreq.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 83c2129..2bd9ab0 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -644,7 +644,7 @@ int devfreq_remove_governor(struct devfreq_governor *governor)
> if (IS_ERR(g)) {
> pr_err("%s: governor %s not registered\n", __func__,
> governor->name);
> - err = -EINVAL;
> + err = PTR_ERR(g);
> goto err_out;
> }
> list_for_each_entry(devfreq, &devfreq_list, node) {
> --
> 1.7.4.1
>
>
>
>
>
>
>
>
????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?