Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6013721rwb; Tue, 17 Jan 2023 23:20:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXtoxlQBvRbrzGLB3hAvXHFu+UuHRG8in42BIeKJBY8d/7wngxsWEF8pUCvLsD0trNy91tAg X-Received: by 2002:a17:906:6454:b0:7c1:277:cb00 with SMTP id l20-20020a170906645400b007c10277cb00mr5776213ejn.23.1674026419069; Tue, 17 Jan 2023 23:20:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674026419; cv=none; d=google.com; s=arc-20160816; b=UWj5zNiBDU0iOBQT/Ti7KxvjhogHCzYcxrI8ji89JUKk63BaH8GWsmRyuJN7bkowcl fZNT26YisS1i7lDLHKYDULMTFpj5Cxsm1x15HlVtnG2EOgl/v3LVv27KvkySykpEL5/K scRsXg3o5jPQ/rkDtsO8bxagj8uiUjf+63L8PfCpP4vGq4Blzcxs2HBij+HWf95zFCqS w7/FrChj3X37p3u6056MpCkPIIdN4QFoFL1+uJalNmnTHCZ3yR4C48efxhEUC1kDqFY7 JtpEoRDazDrX023tDvMGUFs3jXD9bApLpcoOHe2ZDbXIHCwtXJcKAgYl3s5JblCeTyIo 21Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=woicIWywMPyEsGfjzqeJZVmpu2C7tQguryCnNThhvE8=; b=uO+8F3S38kHeUTEjJf7vFd9aW2me+dyJNcZdRaBVg2kgEUGdQQ03VUZZztTjgjA5w/ EcPonSTHlUs3tIuF/uWzPMG3vB1tbbsLxPKYLUN703oqLRcBVNxZXA8fca/rqTU3HKx8 /MpYm+HuQy1Qbnfxa0WBMqVNf2l9euYqr90Tc88yRzmAaEIzF0tS33fN/2MSbcmA0pb5 J4vTUeM95SXhyhLGhW+o6NfkJwlXtgXqHT/bYJneIjXYCzkMsK2buXE2Aj9Knri5uor2 N1aM+m2kBU4rmPKvmg97Shy62QUE7zFCg0q+SraOTanckHwlFr+eblP01d4oO7wV3MdJ e3dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=JdZLevug; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wu1-20020a170906eec100b0078d2a99972fsi28832861ejb.316.2023.01.17.23.20.07; Tue, 17 Jan 2023 23:20:19 -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=JdZLevug; 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 S230152AbjARGqA (ORCPT + 46 others); Wed, 18 Jan 2023 01:46:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjARG3S (ORCPT ); Wed, 18 Jan 2023 01:29:18 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB613A5A5; Tue, 17 Jan 2023 22:20:46 -0800 (PST) X-UUID: 3be10a6e96f811eda06fc9ecc4dadd91-20230118 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=woicIWywMPyEsGfjzqeJZVmpu2C7tQguryCnNThhvE8=; b=JdZLevugZXOLN+C2wShJ69Re1kJjMBfPHhXlw5HfJDOhmqxyViXHuoAHC/XBRfcovu+R30bstILwkMRkFsMqqLghTAqjrs5/eH9vTcIkFCKEqF+1oLBnkvqLlZnLVXP7nzIaJyjeMs8EPm0h1Vjg8b0M8JXgycRFqfzLRfHSPPs=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.18,REQID:cbebf069-71d1-424f-8a79-8c83fb4e4ced,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:3ca2d6b,CLOUDID:ade3fa54-dd49-462e-a4be-2143a3ddc739,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 X-CID-BVR: 0 X-UUID: 3be10a6e96f811eda06fc9ecc4dadd91-20230118 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 1939044672; Wed, 18 Jan 2023 14:20:41 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 18 Jan 2023 14:20:40 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 18 Jan 2023 14:20:40 +0800 From: Guodong Liu To: Sean Wang , Linus Walleij , Matthias Brugger , Light Hsieh , Rob Herring , AngeloGioacchino Del Regno CC: , , , , Zhiyong Tao , Guodong Liu Subject: [PATCH 1/2] pinctrl: mediatek: Initialize variable pullen and pullup to zero Date: Wed, 18 Jan 2023 14:20:35 +0800 Message-ID: <20230118062036.26258-2-Guodong.Liu@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230118062036.26258-1-Guodong.Liu@mediatek.com> References: <20230118062036.26258-1-Guodong.Liu@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAY_BE_FORGED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=no 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 Coverity spotted that pullen and pullup is not initialized to zero in mtk_pctrl_show_one_pin. The uninitialized variable pullen is used in assignment statement "rsel = pullen;" in mtk_pctrl_show_one_pin, and Uninitialized variable pullup is used when calling scnprintf. Fix this coverity by initializing pullen and pullup as zero. Fixes: 184d8e13f9b1 ("pinctrl: mediatek: Add support for pin configuration dump via debugfs.") Signed-off-by: Guodong Liu --- drivers/pinctrl/mediatek/pinctrl-paris.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c index f2ce3f626dd1..e736c1610f3c 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -635,7 +635,7 @@ static int mtk_hw_get_value_wrap(struct mtk_pinctrl *hw, unsigned int gpio, int ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw, unsigned int gpio, char *buf, unsigned int buf_len) { - int pinmux, pullup, pullen, len = 0, r1 = -1, r0 = -1, rsel = -1; + int pinmux, pullup = 0, pullen = 0, len = 0, r1 = -1, r0 = -1, rsel = -1; const struct mtk_pin_desc *desc; u32 try_all_type = 0; -- 2.25.1