Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2454098rwj; Mon, 19 Dec 2022 04:59:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf596SpbbTxH+3EBaFXiAeyBVVHphq7E2s3joXwG0iewBw9JBhiGOpGzMqVdrNh3BkxKtC5P X-Received: by 2002:a17:902:7e06:b0:189:ed85:94d2 with SMTP id b6-20020a1709027e0600b00189ed8594d2mr37385169plm.1.1671454765444; Mon, 19 Dec 2022 04:59:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671454765; cv=none; d=google.com; s=arc-20160816; b=XCWJtaHb7bwWgX8Mn1+HdSIRuKWhIuaGTBEF8Ij5g9j620OkKjgpWQhztYzpwZnaFG M8nkU8rqbECE8KcAskWQRkNVezA2Ky3YULxRGfl4y5TEzaMPdJ9tTKeJHyQZF0w1ncwp EZzsZAPsW2y/miy58Bzbsy7p4cRiWcVkeAL8Dx3BhKpV1+ns3I6yHS+906VRlgAWUErp DtbSX1FBpAfdPG4CMp5Ji9H2SqadGIHA4QQFRjNcrowiWY11RzUIqMPwb246cP4Q1zvk lAqsjlK5XOloviC5egDZAoNVHWlbE6ZORiJOWQtBNTzs7oEc54jASp84hV3PUB8pvpP4 4bMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=q4ZCzHGFabyIf+mU3IYbONCXo9Kh1YOjvxNah7WUkQQ=; b=zxiXmBBZv+q9pqmmq2VSwst0twZ5n4T0SDsJ1xSBdioBaGD8huBVXmmk7IEaSgWa3r mTMlqIF6Z0zj9Nh18kTbjs5Wfe8NqfCTNaIktvhiA9YPAQAUrQGaULzU3xju0DwFWX2d ApyP4mtQXvXxcFvdgpxVyxBzatM0QQ/M2larqOqRDgez0GIoveZzNXJGsJM998xoLW0D 6QWCWpD7W/GeOpPgU8tpx+n0GGrCvbYGgLlzweVc8MQgSJYN7R/z/XEz8jAZN/+QsYBk 1C6wRdxAXs254lkx9NVYhyLk41LWba2UUJ1+xBpt4qw/OHqs1JcyUwVyvkBFoHAZoqnf J20w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="a/LhDt/4"; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jw19-20020a170903279300b00189f4d813f8si9781376plb.578.2022.12.19.04.59.16; Mon, 19 Dec 2022 04:59:25 -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=@intel.com header.s=Intel header.b="a/LhDt/4"; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231654AbiLSMUc (ORCPT + 70 others); Mon, 19 Dec 2022 07:20:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbiLSMUa (ORCPT ); Mon, 19 Dec 2022 07:20:30 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA1682BC3; Mon, 19 Dec 2022 04:20:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671452429; x=1702988429; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=FpYAPKna/QrtXHDcnodhTDjW1+/oAPh/VEk9ch82x9U=; b=a/LhDt/4td4Ts0rC+uSttX6UgkDOMorWvBZ0JHPWe1HjrONLqP5plcgQ YzhHxq7BybDfSHMs5ZuHLTZ26/Kq1lrbH4KVcLa5UaARixVnjhmskl6GC jKOBNvATD3SRvDuQUUJd/nZ0SgmFddEZlqtP1GWIT+0+DbUYxzKoUoo9Y AP+HRHxZuC5Zgs+6oqWxSPYWpWjykJ8W8OARz9rANSNiVnzqUPbWvcK6l UqmVPppQ97caqinK5lctzC5qpTGJMChPG/679cCsrpLo+KrdaWqU7Hb7H 2xJySEQkcpPlE5ZFW67hbxQLpQ8JsNH+oQubiiylWV0XqYjywn0lDhfJt w==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="405588710" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="405588710" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:20:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="739317797" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="739317797" Received: from unknown (HELO localhost.localdomain) ([10.237.112.144]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:20:26 -0800 Date: Mon, 19 Dec 2022 13:20:16 +0100 From: Michal Swiatkowski To: Horatiu Vultur Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, lars.povlsen@microchip.com, Steen.Hegelund@microchip.com, daniel.machon@microchip.com, UNGLinuxDriver@microchip.com, kernel test robot , Dan Carpenter , Saeed Mahameed Subject: Re: [PATCH net v2] net: microchip: vcap: Fix initialization of value and mask Message-ID: References: <20221219082215.76652-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221219082215.76652-1-horatiu.vultur@microchip.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 On Mon, Dec 19, 2022 at 09:22:15AM +0100, Horatiu Vultur wrote: > 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 > --- > 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]; > > -- > 2.38.0 Looks fine Reviewed-by: Michal Swiatkowski