diff mbox

devfreq: fix return value check in devfreq_init()

Message ID CAPgLHd9J4LL9SvxN1FeibN-gaCsoFu6o=PSGZDnzS4Ha1yN69w@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Wei Yongjun Oct. 25, 2013, 1:52 p.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function create_freezable_workqueue() returns
NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/devfreq/devfreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

MyungJoo Ham Oct. 29, 2013, 7:19 a.m. UTC | #1
On Fri, Oct 25, 2013 at 10:52 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function create_freezable_workqueue() returns
> NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

I'm sorry but I've found that this is duplicated with a previous
(pending) patch.



Cheers,
myungJoo.

> ---
>  drivers/devfreq/devfreq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index c99c00d..22e5d2f 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -993,10 +993,10 @@ static int __init devfreq_init(void)
>         }
>
>         devfreq_wq = create_freezable_workqueue("devfreq_wq");
> -       if (IS_ERR(devfreq_wq)) {
> +       if (!devfreq_wq) {
>                 class_destroy(devfreq_class);
>                 pr_err("%s: couldn't create workqueue\n", __FILE__);
> -               return PTR_ERR(devfreq_wq);
> +               return -ENOMEM;
>         }
>         devfreq_class->dev_groups = devfreq_groups;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index c99c00d..22e5d2f 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -993,10 +993,10 @@  static int __init devfreq_init(void)
 	}
 
 	devfreq_wq = create_freezable_workqueue("devfreq_wq");
-	if (IS_ERR(devfreq_wq)) {
+	if (!devfreq_wq) {
 		class_destroy(devfreq_class);
 		pr_err("%s: couldn't create workqueue\n", __FILE__);
-		return PTR_ERR(devfreq_wq);
+		return -ENOMEM;
 	}
 	devfreq_class->dev_groups = devfreq_groups;