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 ED4B2ECAAA1 for ; Sat, 17 Sep 2022 20:16:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 295E780008; Sat, 17 Sep 2022 16:16:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 244B580007; Sat, 17 Sep 2022 16:16:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10F5580008; Sat, 17 Sep 2022 16:16:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id F379E80007 for ; Sat, 17 Sep 2022 16:16:10 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BFC7B1A0444 for ; Sat, 17 Sep 2022 20:16:10 +0000 (UTC) X-FDA: 79922684100.05.00B97B0 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf28.hostedemail.com (Postfix) with ESMTP id B28AEC00D0 for ; Sat, 17 Sep 2022 20:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663445769; x=1694981769; h=date:from:to:cc:subject:message-id:mime-version; bh=QQ3xTSeoFf133+7XRyYGf6pwOTfZdW9EywVHSTYX/Mo=; b=PmRtliaGg2I7DAqCbQxbs2V/HlLMleqsqRaJ15iJz188qfMCo6jEqiW5 XTV7cBT/5H59Q077wolRl3RT4NBeN32hPFFpr+1Nq3TI+h+pd9boPlfUF IpN/KQTb3OmA2xexx5oVFQ+1Mz4PWVfu6zL9NPu1a54okklZyO35Ubw4+ 0mfFgiKtsPuJ9bIqdO/u0cKLUiJqwR9IGleaaimA0FBN1t2PzFvInLdwf X6V+VUVpE3QAdNyDRpWD3U0lXKVjIy58FWfZ/WYYFWJ56u2Ah6cBwMbb9 T7tZDLBnez263Y0D/CpAHOHV2GsY8B4YVMkxxuk5bKUoeh2zO/1E64EYy A==; X-IronPort-AV: E=McAfee;i="6500,9779,10473"; a="300549690" X-IronPort-AV: E=Sophos;i="5.93,323,1654585200"; d="scan'208";a="300549690" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2022 13:16:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,323,1654585200"; d="scan'208";a="569198742" Received: from lkp-server01.sh.intel.com (HELO c0a60f19fe7e) ([10.239.97.150]) by orsmga003.jf.intel.com with ESMTP; 17 Sep 2022 13:16:06 -0700 Received: from kbuild by c0a60f19fe7e with local (Exim 4.96) (envelope-from ) id 1oZeEP-0000Zf-1N; Sat, 17 Sep 2022 20:16:05 +0000 Date: Sun, 18 Sep 2022 04:15:19 +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 4848/7639] 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: <202209180446.ALAcTaPL-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663445770; 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=wC97Xw55AVtnmXs8KKADkZQ/7NUJ5ipOup4oiQTcmB0=; b=tj0hnALXAiWxLiaU8OyV13Z5D7LXHVUCXR0S3GZmcrwYcLzEAV34LDf4+YCn95TMA6CPgd pDggirQRvyAhuZfso/zaNan9hRAcIFX2C9kfxwSvs4YaQKsbruy+DG13GwqsCFGtSVk9bh CYxDI54aC1eSsDqSxzYGydlYB91egRE= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=PmRtliaG; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf28.hostedemail.com: domain of lkp@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663445770; a=rsa-sha256; cv=none; b=AWP7FW8QTEhzMSlnYw3fDgm8PIokTZg8JeFsUO5zFGDMse9l96Kjj61o40SbdYG0oQLv/d xVXfwwW3WdMw2OFVbn+nP+cPeW3Z2fVh4D0mS/UUaxenj6pQJNIt8X69qgVihAWFR2AZmi tHqYnpICkGmqjE/Sj/DWdkTC7Z7Fy1E= X-Stat-Signature: scrioq6aaos7t1icfsgxx7eu8ub7piac X-Rspamd-Queue-Id: B28AEC00D0 Authentication-Results: imf28.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=PmRtliaG; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf28.hostedemail.com: domain of lkp@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=lkp@intel.com X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1663445769-739011 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: Hi Lior, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: d5538ab91d3a9a237805be6f8c6c272af2987995 commit: 3b20949cb21bac26d50cdcc58896802a890cfe15 [4848/7639] net/mlx5e: Add MACsec RX steering rules config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220918/202209180446.ALAcTaPL-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