linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / OPP: fix odd_ptr_err.cocci warnings
@ 2016-12-02 15:13 Julia Lawall
  2016-12-05  3:14 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2016-12-02 15:13 UTC (permalink / raw)
  To: philip.li, Viresh Kumar; +Cc: linux-pm, kbuild-all

 PTR_ERR should access the value just tested by IS_ERR

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

I haven't checked the context, but the code looks suspicious.

This is derived from the following tree:

tree:   https://git.linaro.org/people/vireshk/linux opp/redesign
head:   fbf8f0c337a7cfcd4cb67865b5ea710e69c21f1f
commit: 5fe43a6b46470d22938bc443cf0ea20ed01a93b6 [32/33] PM / OPP: Take
kref from _find_opp_table()
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago

 core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/base/power/opp/core.c
+++ b/drivers/base/power/opp/core.c
@@ -644,7 +644,7 @@ int dev_pm_opp_set_rate(struct device *d
 	if (IS_ERR(clk)) {
 		dev_err(dev, "%s: No clock available for the device\n",
 			__func__);
-		ret = PTR_ERR(opp_table);
+		ret = PTR_ERR(clk);
 		goto put_opp_table;
 	}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PM / OPP: fix odd_ptr_err.cocci warnings
  2016-12-02 15:13 [PATCH] PM / OPP: fix odd_ptr_err.cocci warnings Julia Lawall
@ 2016-12-05  3:14 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2016-12-05  3:14 UTC (permalink / raw)
  To: Julia Lawall; +Cc: philip.li, linux-pm, kbuild-all

On 02-12-16, 16:13, Julia Lawall wrote:
>  PTR_ERR should access the value just tested by IS_ERR
> 
> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
> 
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
> I haven't checked the context, but the code looks suspicious.
> 
> This is derived from the following tree:
> 
> tree:   https://git.linaro.org/people/vireshk/linux opp/redesign
> head:   fbf8f0c337a7cfcd4cb67865b5ea710e69c21f1f
> commit: 5fe43a6b46470d22938bc443cf0ea20ed01a93b6 [32/33] PM / OPP: Take
> kref from _find_opp_table()
> :::::: branch date: 4 hours ago
> :::::: commit date: 4 hours ago
> 
>  core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/base/power/opp/core.c
> +++ b/drivers/base/power/opp/core.c
> @@ -644,7 +644,7 @@ int dev_pm_opp_set_rate(struct device *d
>  	if (IS_ERR(clk)) {
>  		dev_err(dev, "%s: No clock available for the device\n",
>  			__func__);
> -		ret = PTR_ERR(opp_table);
> +		ret = PTR_ERR(clk);
>  		goto put_opp_table;
>  	}

Fixed, thanks.

-- 
viresh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-05  3:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-02 15:13 [PATCH] PM / OPP: fix odd_ptr_err.cocci warnings Julia Lawall
2016-12-05  3:14 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).