From patchwork Thu May 31 22:21:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 137443 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp186342lji; Thu, 31 May 2018 15:21:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIcEg6JYTVfkkuLmJZh4PIprTpAU9B2GXzQAzaCYpUL87aV65fRen3relfIEIkJboxeD6oT X-Received: by 2002:a17:902:265:: with SMTP id 92-v6mr8408251plc.368.1527805318459; Thu, 31 May 2018 15:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527805318; cv=none; d=google.com; s=arc-20160816; b=nZVhIhO7khbKdc+CNF4ZCJkUxur9QELdleF4NEj+JKBig10QTKMTe6J41dT6UAaAs2 JmwvFr9/3nXDJDJbVIOn6/ooc1pwGIg+dsRaVoJJL8uweq5P1kjz4ZBsOJxl5a0ljfXx yF9IO/34PkGDNb707QhPwJM2alFjeGgqp8vx1BW/DicyBlvFg7khwx2tYkbe7DHBJv4l fE1rwVW13dJwCSrOJkWYc9mZbPun5er3FeF9TnwJIjQ7/Krnc8nYEXaJumZlNWa/yLqL y7745mQnylY0wRx2t/cybbqubttvO6AeY8b/JTIOx5eAQSORJc6e++R8I7S+RQQDv3c/ SulA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=e7DdGGGFpwoNcoSvfgO5vivuRMxBLts8jos8PMm5hO4=; b=oRU8Otp7tzUDSZfwGPcb1Ih2bdUF9VwJxIK2GEQWhTFelp/D3wTphOLQlep5YpiWxG Q0SHeXj0JbU9ik7ie1eGDrHlAFYsZZvv5AYnYK4JJhNpief9Z9YwS2MtUepO3JHSSaYa bi4SQU8LwdvWo6ijKzO7c7aOMHToWnjUFiXwYbO6h1UqdaFT+aYqybnWHcttGo3+lU6u 8ykAD2+i6zq3hb/haWkmDTt0BXQMkUnB2Ho7XKRIuRkLwg4y12cXpXNxKBI8Pismpw93 GmevaIHTAGkhlLEz1PnWLyaXHVDvASHkBQmO6+z7Y29rMTYDR/MAEDdCr6xOwRd++9+n BxYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=HYzuTY9C; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b62-v6si10818024pfm.104.2018.05.31.15.21.58; Thu, 31 May 2018 15:21:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=HYzuTY9C; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974AbeEaWV4 (ORCPT + 5 others); Thu, 31 May 2018 18:21:56 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:30020 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbeEaWVu (ORCPT ); Thu, 31 May 2018 18:21:50 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w4VMLkcX022857; Thu, 31 May 2018 17:21:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1527805307; bh=oQt82XafEX2eBOYVfIm+rdSJGOO9Eb+k1DeZTWU2wqY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HYzuTY9Cxs6XehvvpQwEgd9J2r3X/RkTr+J/EXU07zM32RS+dOn9t3jfFjdEDnEKn qrYKHmw84MDAjELPk2gycqLCYzdZwZVTDfVp+FApvMUxLsaRVAWC3rf/lRVpzFYb3S hKRyzDEdzEaOWErvtvnbL7E2sgBV54TouiXwZnBE= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4VMLkcb019449; Thu, 31 May 2018 17:21:46 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 31 May 2018 17:21:46 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 31 May 2018 17:21:46 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4VMLkPI007120; Thu, 31 May 2018 17:21:46 -0500 Received: from localhost (irmo.dhcp.ti.com [128.247.58.153]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w4VMLkx09899; Thu, 31 May 2018 17:21:46 -0500 (CDT) From: Suman Anna To: "Rafael J. Wysocki" CC: Viresh Kumar , Dave Gerlach , Tero Kristo , , , , Suman Anna , Zumeng Chen , Subject: [PATCH v3 1/2] cpufreq: ti-cpufreq: Fix an incorrect error return value Date: Thu, 31 May 2018 17:21:43 -0500 Message-ID: <20180531222144.26739-2-s-anna@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180531222144.26739-1-s-anna@ti.com> References: <20180531222144.26739-1-s-anna@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Commit 05829d9431df ("cpufreq: ti-cpufreq: kfree opp_data when failure") has fixed a memory leak in the failure path, however the patch returned a positive value on get_cpu_device() failure instead of the previous negative value. Fix this incorrect error return value properly. Fixes: 05829d9431df ("cpufreq: ti-cpufreq: kfree opp_data when failure") Cc: Zumeng Chen Cc: # v4.14+ Signed-off-by: Suman Anna Acked-by: Viresh Kumar --- drivers/cpufreq/ti-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c index 6ba709b6f095..896caba5dfe5 100644 --- a/drivers/cpufreq/ti-cpufreq.c +++ b/drivers/cpufreq/ti-cpufreq.c @@ -226,7 +226,7 @@ static int ti_cpufreq_probe(struct platform_device *pdev) opp_data->cpu_dev = get_cpu_device(0); if (!opp_data->cpu_dev) { pr_err("%s: Failed to get device for CPU0\n", __func__); - ret = ENODEV; + ret = -ENODEV; goto free_opp_data; }