From patchwork Fri Dec 2 15:13:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9458773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1645260236 for ; Fri, 2 Dec 2016 15:19:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0917E284E2 for ; Fri, 2 Dec 2016 15:19:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F22232855C; Fri, 2 Dec 2016 15:19:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CCAE284E2 for ; Fri, 2 Dec 2016 15:19:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754166AbcLBPTB (ORCPT ); Fri, 2 Dec 2016 10:19:01 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:58917 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753350AbcLBPTA (ORCPT ); Fri, 2 Dec 2016 10:19:00 -0500 X-IronPort-AV: E=Sophos;i="5.33,287,1477954800"; d="scan'208";a="202629012" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2016 16:13:47 +0100 Date: Fri, 2 Dec 2016 16:13:33 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: philip.li@intel.com, Viresh Kumar cc: linux-pm@vger.kernel.org, kbuild-all@01.org Subject: [PATCH] PM / OPP: fix odd_ptr_err.cocci warnings Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Fengguang Wu --- 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(-) -- 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 --- 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; }