public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: philip.li@intel.com, Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org, kbuild-all@01.org
Subject: [PATCH] PM / OPP: fix odd_ptr_err.cocci warnings
Date: Fri, 2 Dec 2016 16:13:33 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.10.1612021611340.3056@hadrien> (raw)

 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;
 	}


             reply	other threads:[~2016-12-02 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 15:13 Julia Lawall [this message]
2016-12-05  3:14 ` [PATCH] PM / OPP: fix odd_ptr_err.cocci warnings Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1612021611340.3056@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=kbuild-all@01.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=philip.li@intel.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox