From patchwork Mon Dec 19 08:22:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 13076352 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B28E6C4332F for ; Mon, 19 Dec 2022 08:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sm6q8TY10LVjIyJCMDAXpQEn1+xgqja3M7O93GRkR84=; b=rhzGeIL7KL9ECo wXjPz5lHiezQMqkgPDfh7q3DYHtlDL3P0IoqlqgyZfzrwLYb4xz3R2g8OLPvhNPpNQAwAG3edj/h9 zD6LP65cKhLJrLcyz13WOrCNivFh3nKoJQabz85TxiSyL9e0u0tXkJZ/dSANNFO0Ta/lR4qc5H7lg 68pY9cbmgNDqFgZETB5bUU2E+HFruN9mGgyl+p1T4nUXcBxCoKyWQNQuB/IYBsi0e5pAIRA21lP4F ZI0pjrdQN+O7OcsD5AA/qEC23kxezipYi+GsPY//fjJk1tEB9huKasHYkKgRMxHrdZ9K53xXCYdim Ubu5+sF3Pu39oPrK4u/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7BL1-00ARsR-6v; Mon, 19 Dec 2022 08:17:31 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7BKw-00ARjp-9x for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 08:17:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1671437846; x=1702973846; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=y+btHyYZt6deb9ZTjxKgTd1t5WxObKlAJo5VmP00Z6U=; b=jBFem+VCGkoZ6VKLU3jCwCTMkz7aoOQX64mzrr3HB9nn7y/h4F1KPCyu THZz3NLgTXizujdyMkYCkANXLaxeWUUhw4PI6irXBqg/uZFoPYi9S8FWO aCzkWp15oXw04yJ03jJR+RABuhJfHptLaijUq0/FOgV8KAJZzJBwPCGCz duakAVKsDDWVXRx4PubtwE7/BLBK/vMHEB+9BpVv1x6oK0Q5l7fUbX7Sb LAN9MEdQ3dxDLeJVW56r8Gc2bCYA/FeQZMTM/sXYhnxat16Lno+NIusJ0 DPCOtNrLtQZJyml41j+aAzmUWM8xISnXuPTquLRICEzaadEU7qjce63CI g==; X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="128773399" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 19 Dec 2022 01:17:09 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 19 Dec 2022 01:17:08 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 19 Dec 2022 01:17:06 -0700 From: Horatiu Vultur To: , , CC: , , , , , , , , Horatiu Vultur , kernel test robot , "Dan Carpenter" , Saeed Mahameed Subject: [PATCH net v2] net: microchip: vcap: Fix initialization of value and mask Date: Mon, 19 Dec 2022 09:22:15 +0100 Message-ID: <20221219082215.76652-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_001726_484775_1582A5B2 X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix the following smatch warning: smatch warnings: drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c:103 vcap_debugfs_show_rule_keyfield() error: uninitialized symbol 'value'. drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c:106 vcap_debugfs_show_rule_keyfield() error: uninitialized symbol 'mask'. In case the vcap field was VCAP_FIELD_U128 and the key was different than IP6_S/DIP then the value and mask were not initialized, therefore initialize them. Fixes: 610c32b2ce66 ("net: microchip: vcap: Add vcap_get_rule") Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Saeed Mahameed Signed-off-by: Horatiu Vultur Reviewed-by: Michal Swiatkowski --- v1->v2: - rebase on net - both the mask and value were assigned to data->u128.value, which is wrong, fix this. --- drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c index 895bfff550d23..e0b206247f2eb 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c @@ -83,6 +83,8 @@ static void vcap_debugfs_show_rule_keyfield(struct vcap_control *vctrl, hex = true; break; case VCAP_FIELD_U128: + value = data->u128.value; + mask = data->u128.mask; if (key == VCAP_KF_L3_IP6_SIP || key == VCAP_KF_L3_IP6_DIP) { u8 nvalue[16], nmask[16];