From patchwork Tue Mar 7 04:09:38 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: 65260 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2232628wrd; Mon, 6 Mar 2023 20:17:44 -0800 (PST) X-Google-Smtp-Source: AK7set+zLIxcX+lkvF7t10rj/V4N+OihnIf9AO6PbhNu/1YgANyS+CeZUZOLutuS8kwYOZTB/Hz2 X-Received: by 2002:aa7:d60b:0:b0:4bd:94b9:b8a8 with SMTP id c11-20020aa7d60b000000b004bd94b9b8a8mr11185081edr.26.1678162664679; Mon, 06 Mar 2023 20:17:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678162664; cv=none; d=google.com; s=arc-20160816; b=tFxpKykTypKqFQ+M86wJdj8CRL3mT07BZfeZEm8FaafwbAHg+H+aJjACUqXnCIiKF5 UJxZMFovqeaDDodAMgZ13KjUvc+uh41HsAIPTqdTHax1Gd9zOBhqcSEOdQSJvreoncG6 xKFEayXZUUxgg8v+CnDXoSoJUflfLTAzpvgf3g9RfykwRppJl8rf8mD3erUva2b5oIUK aMo7E8MPBS9ZqrVBKa7npI76RdWkAXJFRVoIUNsN2q1sPKcl0TBCJKVOBwWyZy2jg5tC s58nEckXK/Pcrg71hpGWqbfpoQkSlrrxCNKPU7W55RzGbrYIH2qpR/GP3pW5MFsRF44b szgQ== 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=zry3CdQy1hd/hNFQW6ZaJHATpV3S72d/XIVP2MJTS9I=; b=qmEsAfJj46gcdLQdU1fQA9WHAOdHRum5YgACOXL2xBZS4JuARyiJxZcfsq9jewsUP2 iBeF65d+hE4TOepmHv9I0LwxHes0nDFxYSUoacuXU1eKP0LF2fcwGIzbgvj/9JqmqCdR az98Ov1kosxIPS4KIaHZtYq7BD7Jt2pUKnlO4FmVfroYHEsuH0eWWyGOkfPO9M2Tvbwr TqvMKak5aV6JP60AywauysfobdKNIaMK/qnUla9V51/HDLHEir2YCAZxLcC7/WeEAgJP JsMFwnwr8FkPSkNVF7w/RAc6kQY55vR2JcibGHR01uupxM5xUmyZOU/WLG7zsyvTLdsT Sg0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ho1N5Rg1; 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 e25-20020a50fb99000000b004acc690bf26si10310301edq.490.2023.03.06.20.17.20; Mon, 06 Mar 2023 20:17:44 -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=ho1N5Rg1; 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 S229880AbjCGEJt (ORCPT + 99 others); Mon, 6 Mar 2023 23:09:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjCGEJr (ORCPT ); Mon, 6 Mar 2023 23:09:47 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54CDA34F40 for ; Mon, 6 Mar 2023 20:09:44 -0800 (PST) X-UUID: e3396adebc9d11eda06fc9ecc4dadd91-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=zry3CdQy1hd/hNFQW6ZaJHATpV3S72d/XIVP2MJTS9I=; b=ho1N5Rg1Vls3DiDR4BP1SQLRwjkiomsCNYKGErnPSaj31MFuOTC0jqdLpD83q32UnMAga/0u/MVyDCky6DLm+CRQcfNHGNYhNPQNUBbE61MJ+a5+kg7KEBifeUw0SgXsi4RqEbfKuPOJSlzX/OkjFSsKEAisg2YQNdSNWUa4BwY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20,REQID:84dd1f4a-05cc-4b46-a454-06e8b31ecbd4,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:25b5999,CLOUDID:9d158c27-564d-42d9-9875-7c868ee415ec,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: e3396adebc9d11eda06fc9ecc4dadd91-20230307 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 349648961; Tue, 07 Mar 2023 12:09:42 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs11n1.mediatek.inc (172.21.101.185) 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 4/4] ASoC: mediatek: mt6359: fix UNINIT problem Date: Tue, 7 Mar 2023 12:09:38 +0800 Message-ID: <20230307040938.7484-5-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?1759681094384339547?= X-GMAIL-MSGID: =?utf-8?q?1759681094384339547?= 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/mt6359.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/mt6359.c b/sound/soc/codecs/mt6359.c index c9a453ce8a2a..cb487e63615c 100644 --- a/sound/soc/codecs/mt6359.c +++ b/sound/soc/codecs/mt6359.c @@ -358,7 +358,7 @@ static int mt6359_put_volsw(struct snd_kcontrol *kcontrol, struct mt6359_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 index = ucontrol->value.integer.value[0]; int ret;