From patchwork Tue Mar 7 04:09:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?VHJldm9yIFd1ICjlkLPmlofoia8p?= X-Patchwork-Id: 65258 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2231518wrd; Mon, 6 Mar 2023 20:13:57 -0800 (PST) X-Google-Smtp-Source: AK7set8cFTJ5RebFtsCCinzImNSCVF69Fv9cDr+Wpnl3gprEijv+L0CvWzyTXDmqsz7gCoPLSBpI X-Received: by 2002:a17:902:dacd:b0:19a:96f0:b0f with SMTP id q13-20020a170902dacd00b0019a96f00b0fmr14231171plx.28.1678162437096; Mon, 06 Mar 2023 20:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678162437; cv=none; d=google.com; s=arc-20160816; b=CINms86KaqsHVLh8tuETooGsUxTk8bI0X1/BBoxFurwebAYd3PJLoAbO2SMTPN28xZ iSPh7Htni9h8p9IECxbHCjqkjwiq08b85KluZZZ4zB/EUXUCwiq9uGw1HUFuOYiGbQSM ajtg77Ll3H1QNRIDm4YyBuhHGhoViuafRITflEnd71nytpnm9t09KcGYErJnzODB2hYh 5bZRBKkr38ilXssyxzek1IKnlkWseZsuhgVt9jfd4p9SoHnVFqvbeeWyUhVWjSoeL+fZ sHfXT/3VCG0d5Dfr0faGeTntPf+w4SLhd0sbZfwaysYAT44T1JXfpN7bnU5uHtDAkXYi BRsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=jRNnZrN6xFwN19GVWEkePB6Ng03IX8gMpvzlN1+Rj/4=; b=0UrL23HBOYxAdDpk91GX4T9gDcH0E7xbrukGpjm7c8TI9qLAnLWD5Y4Jf31FB6jkoz 3SnZcAjvIl/oqLDtxHfsdIhmRis12xawtIJ7XPRFHxteYNATk5B7QZ3jWkVUvNnH3zlt I4m4li27TkKa4RG2zyoCQKExk6zR/NJpSCVZWNACDW/gAScU8fd8WCMDj+8bXOzcEQNi N75+pCV+9HR1+iqcvTWx2HO4MI9ivEWrOXwTmXNcvmKhv+FjEJpbOX6fYj+4/Ywh/DQ9 GgqYsLu8bgXH+BHkTcxVjLVX472re4eWM0rLQ0t6YrLXjJRilxavQpJwIcqCNFb/5YRn ZF2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ROFlP43y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kh12-20020a170903064c00b0019e2797720csi10240879plb.201.2023.03.06.20.13.44; Mon, 06 Mar 2023 20:13:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ROFlP43y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230171AbjCGEKI (ORCPT + 99 others); Mon, 6 Mar 2023 23:10:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbjCGEJv (ORCPT ); Mon, 6 Mar 2023 23:09:51 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A2F634F54 for ; Mon, 6 Mar 2023 20:09:49 -0800 (PST) X-UUID: e38108e4bc9d11ed945fc101203acc17-20230307 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=jRNnZrN6xFwN19GVWEkePB6Ng03IX8gMpvzlN1+Rj/4=; b=ROFlP43yU6H/Gi0ljdmb7sk3Xm2Z5C162ql+hP/2xved6bE2pI8Il2oCQGhYajFts2/l3M1OVLIsszzkJiypZ0aLrAEcaQseVwlus5z9QcUe8qvKjXjLwQ/spwfcwCStzDNg/uLrITXCLx9FhUr1PDY24Q+Q6dGbxWpZ7KdmN3M=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20,REQID:524be16c-f72f-47ea-8af2-39f0d6403061,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:25b5999,CLOUDID:40c56cb2-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: e38108e4bc9d11ed945fc101203acc17-20230307 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 93485341; Tue, 07 Mar 2023 12:09:43 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Tue, 7 Mar 2023 12:09:42 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Tue, 7 Mar 2023 12:09:42 +0800 From: Trevor Wu To: , , , , , CC: , , , , , Subject: [PATCH 3/4] ASoC: mediatek: mt6358: fix UNINIT problem Date: Tue, 7 Mar 2023 12:09:37 +0800 Message-ID: <20230307040938.7484-4-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230307040938.7484-1-trevor.wu@mediatek.com> References: <20230307040938.7484-1-trevor.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759680855307552689?= X-GMAIL-MSGID: =?utf-8?q?1759680855307552689?= Coverity shows decaring variable reg without initializer. When regmap_read returns an error, reg keeps the value left from earlier computation. To prevent from the unexpected result in the case, assign 0 to reg. Signed-off-by: Trevor Wu --- sound/soc/codecs/mt6358.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c index b54610b27906..d7b157ddc9a8 100644 --- a/sound/soc/codecs/mt6358.c +++ b/sound/soc/codecs/mt6358.c @@ -429,7 +429,7 @@ static int mt6358_put_volsw(struct snd_kcontrol *kcontrol, struct mt6358_priv *priv = snd_soc_component_get_drvdata(component); struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; - unsigned int reg; + unsigned int reg = 0; int ret; ret = snd_soc_put_volsw(kcontrol, ucontrol);