From patchwork Mon Jan 6 12:05:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 190778 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B39EC33C8C for ; Mon, 6 Jan 2020 12:06:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C2B020731 for ; Mon, 6 Jan 2020 12:06:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725821AbgAFMGG (ORCPT ); Mon, 6 Jan 2020 07:06:06 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:43311 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbgAFMGG (ORCPT ); Mon, 6 Jan 2020 07:06:06 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ioR8w-0008Es-8J; Mon, 06 Jan 2020 12:05:58 +0000 From: Colin King To: Andy Gross , Bjorn Andersson , Niklas Cassel , Kevin Hilman , Nishanth Menon , "Rafael J . Wysocki" , Jorge Ramirez-Ortiz , Ulf Hansson , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] power: avs: fix uninitialized error return on failed cpr_read_fuse_uV call Date: Mon, 6 Jan 2020 12:05:58 +0000 Message-Id: <20200106120558.37758-1-colin.king@canonical.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Colin Ian King Currently when the call cpr_read_fuse_uV returns an error the value in the uninitialized variable ret is returned. Fix this by instread returning the error value in the variable uV. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)") Signed-off-by: Colin Ian King Reviewed-by: Bjorn Andersson --- drivers/power/avs/qcom-cpr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/avs/qcom-cpr.c b/drivers/power/avs/qcom-cpr.c index 9247f53550b3..0321729431a5 100644 --- a/drivers/power/avs/qcom-cpr.c +++ b/drivers/power/avs/qcom-cpr.c @@ -922,7 +922,7 @@ static int cpr_fuse_corner_init(struct cpr_drv *drv) uV = cpr_read_fuse_uV(desc, fdata, fuses->init_voltage, step_volt, drv); if (uV < 0) - return ret; + return uV; fuse->min_uV = fdata->min_uV; fuse->max_uV = fdata->max_uV;