From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39A3CECAAD5 for ; Fri, 9 Sep 2022 02:04:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 664C38D0003; Thu, 8 Sep 2022 22:04:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6149F8D0001; Thu, 8 Sep 2022 22:04:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DC818D0003; Thu, 8 Sep 2022 22:04:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3AB228D0001 for ; Thu, 8 Sep 2022 22:04:47 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0759780663 for ; Fri, 9 Sep 2022 02:04:47 +0000 (UTC) X-FDA: 79890903414.05.EC879D8 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf19.hostedemail.com (Postfix) with ESMTP id 70F771A0064 for ; Fri, 9 Sep 2022 02:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662689085; x=1694225085; h=date:from:to:cc:subject:message-id:mime-version; bh=VmMEgv8Mus6S0QL8DMJjiRYOlIDwGAimk3Z5qLBTc7A=; b=bGoRkOkNb4sNig7BVgPYz+b/yQrfhHKExVo5JGF0sSRZr6vaCfdeCJ3q 2ns2GISkCRjbeyoJP0GJ5k2Icsgdg1UL6pl1mcb4D7dkPP8EFsPOkSoa2 5xyQe6s36123qVjsA8ySSQy07JF6YysfTBv7bOitQvzzbqBHts8eyWwGP So79q9thc42z2JKcr6PG86yg+LVvZ5k8ShSQc/UXqAYsCyU/HPTnhHafA 0pzT20sfty1G6jfiR3IeBJRkCgNqMekde7tIWfGi8uJDAcmgsEsbxh0p0 vjurjk9nAbKtsJYWzqJBLBk8+zFSi12t7btm0xW/PVF39r62WBFi3LJEN A==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="297372827" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="297372827" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 19:04:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="943598837" Received: from lkp-server02.sh.intel.com (HELO b2938d2e5c5a) ([10.239.97.151]) by fmsmga005.fm.intel.com with ESMTP; 08 Sep 2022 19:04:41 -0700 Received: from kbuild by b2938d2e5c5a with local (Exim 4.96) (envelope-from ) id 1oWTNp-0000Zx-0S; Fri, 09 Sep 2022 02:04:41 +0000 Date: Fri, 9 Sep 2022 10:03:41 +0800 From: kernel test robot To: Lior Nahmanson Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux Memory Management List , Raed Salem , Saeed Mahameed Subject: [linux-next:master 5241/6188] drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:539:6: warning: variable 'macsec_rule' is used uninitialized whenever 'if' condition is true Message-ID: <202209090936.AOqYoiII-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662689086; a=rsa-sha256; cv=none; b=UHEqFABF4Vct+oBbkpv9klbO7svtEPG4T/gY5fXCfANHRJvV652AixUGXCMImpaLu7MlY6 38ttj6NVwFhSUp7UrjweUkB/BomPJb1SY2xmUzl0OWnI39FWegpLpLk1mFBI02HMhnmqgy xTaWPQEE1yTmiZejS+FdM+HEZLrsL38= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=bGoRkOkN; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf19.hostedemail.com: domain of lkp@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662689086; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=HYAiG6tGnWnUzr82b5wzKcHoqksj/UE4EuQi45PrYP4=; b=ZX8KeUsQKS8kTp6/i5BPbvkDcEnp3wRwBxcvOHu0pYaJ7a0ydPd3z5YpGkYXy6FHZ7XaOS 6qieNtKPQcvjgcg8fyJa1QMPzjlFcwtAQ7lu3RjPOHp3zvWjuGZGHRbvzl6jAaXi8Ojt1+ DDGBcApr4EeC8uJ2uF8/KQvf4bXqDIE= X-Stat-Signature: 56kc4ewh4k7z4c7pwapu57xiadqrm7h3 X-Rspamd-Queue-Id: 70F771A0064 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=bGoRkOkN; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf19.hostedemail.com: domain of lkp@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=lkp@intel.com X-Rspamd-Server: rspam12 X-HE-Tag: 1662689085-140829 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 47c191411b68a771261be3dc0bd6f68394cef358 commit: 3b20949cb21bac26d50cdcc58896802a890cfe15 [5241/6188] net/mlx5e: Add MACsec RX steering rules config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220909/202209090936.AOqYoiII-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3b20949cb21bac26d50cdcc58896802a890cfe15 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 3b20949cb21bac26d50cdcc58896802a890cfe15 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:539:6: warning: variable 'macsec_rule' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (err) ^~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:598:9: note: uninitialized use occurs here return macsec_rule; ^~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:539:2: note: remove the 'if' if its condition is always false if (err) ^~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:523:38: note: initialize the variable 'macsec_rule' to silence this warning union mlx5e_macsec_rule *macsec_rule; ^ = NULL drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1131:6: warning: variable 'macsec_rule' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (err) ^~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1215:9: note: uninitialized use occurs here return macsec_rule; ^~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1131:2: note: remove the 'if' if its condition is always false if (err) ^~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1118:38: note: initialize the variable 'macsec_rule' to silence this warning union mlx5e_macsec_rule *macsec_rule; ^ = NULL 2 warnings generated. vim +539 drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c e467b283ffd50c Lior Nahmanson 2022-09-05 510 3b20949cb21bac Lior Nahmanson 2022-09-05 511 static union mlx5e_macsec_rule * e467b283ffd50c Lior Nahmanson 2022-09-05 512 macsec_fs_tx_add_rule(struct mlx5e_macsec_fs *macsec_fs, e467b283ffd50c Lior Nahmanson 2022-09-05 513 const struct macsec_context *macsec_ctx, 9515978eee0b93 Lior Nahmanson 2022-09-05 514 struct mlx5_macsec_rule_attrs *attrs, 9515978eee0b93 Lior Nahmanson 2022-09-05 515 u32 *sa_fs_id) e467b283ffd50c Lior Nahmanson 2022-09-05 516 { e467b283ffd50c Lior Nahmanson 2022-09-05 517 char reformatbf[MLX5_MACSEC_TAG_LEN + MACSEC_SCI_LEN]; e467b283ffd50c Lior Nahmanson 2022-09-05 518 struct mlx5_pkt_reformat_params reformat_params = {}; e467b283ffd50c Lior Nahmanson 2022-09-05 519 struct mlx5e_macsec_tx *tx_fs = macsec_fs->tx_fs; e467b283ffd50c Lior Nahmanson 2022-09-05 520 struct net_device *netdev = macsec_fs->netdev; e467b283ffd50c Lior Nahmanson 2022-09-05 521 struct mlx5_flow_destination dest = {}; 3b20949cb21bac Lior Nahmanson 2022-09-05 522 struct mlx5e_macsec_tables *tx_tables; 3b20949cb21bac Lior Nahmanson 2022-09-05 523 union mlx5e_macsec_rule *macsec_rule; e467b283ffd50c Lior Nahmanson 2022-09-05 524 struct mlx5e_macsec_tx_rule *tx_rule; e467b283ffd50c Lior Nahmanson 2022-09-05 525 struct mlx5_flow_act flow_act = {}; e467b283ffd50c Lior Nahmanson 2022-09-05 526 struct mlx5_flow_handle *rule; e467b283ffd50c Lior Nahmanson 2022-09-05 527 struct mlx5_flow_spec *spec; e467b283ffd50c Lior Nahmanson 2022-09-05 528 size_t reformat_size; e467b283ffd50c Lior Nahmanson 2022-09-05 529 int err = 0; e467b283ffd50c Lior Nahmanson 2022-09-05 530 u32 fs_id; e467b283ffd50c Lior Nahmanson 2022-09-05 531 3b20949cb21bac Lior Nahmanson 2022-09-05 532 tx_tables = &tx_fs->tables; 3b20949cb21bac Lior Nahmanson 2022-09-05 533 e467b283ffd50c Lior Nahmanson 2022-09-05 534 spec = kvzalloc(sizeof(*spec), GFP_KERNEL); e467b283ffd50c Lior Nahmanson 2022-09-05 535 if (!spec) e467b283ffd50c Lior Nahmanson 2022-09-05 536 return NULL; e467b283ffd50c Lior Nahmanson 2022-09-05 537 e467b283ffd50c Lior Nahmanson 2022-09-05 538 err = macsec_fs_tx_ft_get(macsec_fs); e467b283ffd50c Lior Nahmanson 2022-09-05 @539 if (err) e467b283ffd50c Lior Nahmanson 2022-09-05 540 goto out_spec; e467b283ffd50c Lior Nahmanson 2022-09-05 541 3b20949cb21bac Lior Nahmanson 2022-09-05 542 macsec_rule = kzalloc(sizeof(*macsec_rule), GFP_KERNEL); 3b20949cb21bac Lior Nahmanson 2022-09-05 543 if (!macsec_rule) { e467b283ffd50c Lior Nahmanson 2022-09-05 544 macsec_fs_tx_ft_put(macsec_fs); e467b283ffd50c Lior Nahmanson 2022-09-05 545 goto out_spec; e467b283ffd50c Lior Nahmanson 2022-09-05 546 } e467b283ffd50c Lior Nahmanson 2022-09-05 547 3b20949cb21bac Lior Nahmanson 2022-09-05 548 tx_rule = &macsec_rule->tx_rule; 3b20949cb21bac Lior Nahmanson 2022-09-05 549 e467b283ffd50c Lior Nahmanson 2022-09-05 550 /* Tx crypto table crypto rule */ e467b283ffd50c Lior Nahmanson 2022-09-05 551 macsec_fs_tx_create_sectag_header(macsec_ctx, reformatbf, &reformat_size); e467b283ffd50c Lior Nahmanson 2022-09-05 552 e467b283ffd50c Lior Nahmanson 2022-09-05 553 reformat_params.type = MLX5_REFORMAT_TYPE_ADD_MACSEC; e467b283ffd50c Lior Nahmanson 2022-09-05 554 reformat_params.size = reformat_size; e467b283ffd50c Lior Nahmanson 2022-09-05 555 reformat_params.data = reformatbf; e467b283ffd50c Lior Nahmanson 2022-09-05 556 flow_act.pkt_reformat = mlx5_packet_reformat_alloc(macsec_fs->mdev, e467b283ffd50c Lior Nahmanson 2022-09-05 557 &reformat_params, e467b283ffd50c Lior Nahmanson 2022-09-05 558 MLX5_FLOW_NAMESPACE_EGRESS_MACSEC); e467b283ffd50c Lior Nahmanson 2022-09-05 559 if (IS_ERR(flow_act.pkt_reformat)) { e467b283ffd50c Lior Nahmanson 2022-09-05 560 err = PTR_ERR(flow_act.pkt_reformat); e467b283ffd50c Lior Nahmanson 2022-09-05 561 netdev_err(netdev, "Failed to allocate MACsec Tx reformat context err=%d\n", err); e467b283ffd50c Lior Nahmanson 2022-09-05 562 goto err; e467b283ffd50c Lior Nahmanson 2022-09-05 563 } e467b283ffd50c Lior Nahmanson 2022-09-05 564 tx_rule->pkt_reformat = flow_act.pkt_reformat; e467b283ffd50c Lior Nahmanson 2022-09-05 565 e467b283ffd50c Lior Nahmanson 2022-09-05 566 err = macsec_fs_tx_setup_fte(macsec_fs, spec, &flow_act, attrs->macsec_obj_id, &fs_id); e467b283ffd50c Lior Nahmanson 2022-09-05 567 if (err) { e467b283ffd50c Lior Nahmanson 2022-09-05 568 netdev_err(netdev, e467b283ffd50c Lior Nahmanson 2022-09-05 569 "Failed to add packet reformat for MACsec TX crypto rule, err=%d\n", e467b283ffd50c Lior Nahmanson 2022-09-05 570 err); e467b283ffd50c Lior Nahmanson 2022-09-05 571 goto err; e467b283ffd50c Lior Nahmanson 2022-09-05 572 } e467b283ffd50c Lior Nahmanson 2022-09-05 573 e467b283ffd50c Lior Nahmanson 2022-09-05 574 tx_rule->fs_id = fs_id; 9515978eee0b93 Lior Nahmanson 2022-09-05 575 *sa_fs_id = fs_id; e467b283ffd50c Lior Nahmanson 2022-09-05 576 e467b283ffd50c Lior Nahmanson 2022-09-05 577 flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | e467b283ffd50c Lior Nahmanson 2022-09-05 578 MLX5_FLOW_CONTEXT_ACTION_CRYPTO_ENCRYPT | e467b283ffd50c Lior Nahmanson 2022-09-05 579 MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT; e467b283ffd50c Lior Nahmanson 2022-09-05 580 dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; 3b20949cb21bac Lior Nahmanson 2022-09-05 581 dest.ft = tx_tables->ft_check; 3b20949cb21bac Lior Nahmanson 2022-09-05 582 rule = mlx5_add_flow_rules(tx_tables->ft_crypto.t, spec, &flow_act, &dest, 1); e467b283ffd50c Lior Nahmanson 2022-09-05 583 if (IS_ERR(rule)) { e467b283ffd50c Lior Nahmanson 2022-09-05 584 err = PTR_ERR(rule); e467b283ffd50c Lior Nahmanson 2022-09-05 585 netdev_err(netdev, "Failed to add MACsec TX crypto rule, err=%d\n", err); e467b283ffd50c Lior Nahmanson 2022-09-05 586 goto err; e467b283ffd50c Lior Nahmanson 2022-09-05 587 } e467b283ffd50c Lior Nahmanson 2022-09-05 588 tx_rule->rule = rule; e467b283ffd50c Lior Nahmanson 2022-09-05 589 e467b283ffd50c Lior Nahmanson 2022-09-05 590 goto out_spec; e467b283ffd50c Lior Nahmanson 2022-09-05 591 e467b283ffd50c Lior Nahmanson 2022-09-05 592 err: e467b283ffd50c Lior Nahmanson 2022-09-05 593 macsec_fs_tx_del_rule(macsec_fs, tx_rule); 3b20949cb21bac Lior Nahmanson 2022-09-05 594 macsec_rule = NULL; e467b283ffd50c Lior Nahmanson 2022-09-05 595 out_spec: e467b283ffd50c Lior Nahmanson 2022-09-05 596 kvfree(spec); e467b283ffd50c Lior Nahmanson 2022-09-05 597 3b20949cb21bac Lior Nahmanson 2022-09-05 598 return macsec_rule; e467b283ffd50c Lior Nahmanson 2022-09-05 599 } e467b283ffd50c Lior Nahmanson 2022-09-05 600 :::::: The code at line 539 was first introduced by commit :::::: e467b283ffd50cf15b84c73eef68787e257eaed5 net/mlx5e: Add MACsec TX steering rules :::::: TO: Lior Nahmanson :::::: CC: David S. Miller -- 0-DAY CI Kernel Test Service https://01.org/lkp