From patchwork Mon Apr 2 16:49:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 10320065 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 0B7E960116 for ; Mon, 2 Apr 2018 16:50:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F24082896F for ; Mon, 2 Apr 2018 16:50:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E736F289A2; Mon, 2 Apr 2018 16:50:40 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 9756C2896F for ; Mon, 2 Apr 2018 16:50:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753049AbeDBQuP (ORCPT ); Mon, 2 Apr 2018 12:50:15 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:50966 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753034AbeDBQuM (ORCPT ); Mon, 2 Apr 2018 12:50:12 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w32Go9P4032357; Mon, 2 Apr 2018 11:50:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1522687809; bh=8pgcbRjFOKhzqJaZ8f0STWqm0XpobXsXySVTrTj4vyw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ObF/iuOf7anBFCcUrdXAk0bAilVayg7DZ9q4Xt0NeQs9wBH/9yTkU1KIOZLIKEJAU sQl8qSvkGPgkNJMvGIYKFLFUy8Kr8wnKQN+Um4ukkEdN0q75mRRYEoCsuvya6dJN69 OjqCDeTtksoF561I3ooccu57+Oty+zlTyjidzw9A= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w32Go89b009318; Mon, 2 Apr 2018 11:50:09 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 2 Apr 2018 11:50:05 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 2 Apr 2018 11:50:05 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w32Go5Ds006577; Mon, 2 Apr 2018 11:50:05 -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 w32Go5x06702; Mon, 2 Apr 2018 11:50:05 -0500 (CDT) From: Suman Anna To: Viresh Kumar CC: "Rafael J. Wysocki" , Dave Gerlach , Tero Kristo , , , Suman Anna , Zumeng Chen , Subject: [PATCH v2 1/2] cpufreq: ti-cpufreq: Fix an incorrect error return value Date: Mon, 2 Apr 2018 11:49:57 -0500 Message-ID: <20180402164958.20057-2-s-anna@ti.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180402164958.20057-1-s-anna@ti.com> References: <20180402164958.20057-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 X-Virus-Scanned: ClamAV using ClamSMTP 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: stable@vger.kernel.org Signed-off-by: Suman Anna Acked-by: Viresh Kumar --- drivers/cpufreq/ti-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c index a099b7bf74cd..46d1ab2dea87 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; }