linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Roi Dayan <roid@nvidia.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Mark Bloch <mbloch@nvidia.com>, Maor Dickman <maord@nvidia.com>
Subject: [linux-next:master 2212/3682] drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:481:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false
Date: Sat, 27 Aug 2022 13:50:32 +0800	[thread overview]
Message-ID: <202208271304.MimlzZvl-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8d0c42c9e80791e8baba2932d2cbd2dcead50d47
commit: 430e2d5e2a982e6f86866762e6d6eb78191f9677 [2212/3682] net/mlx5: E-Switch, Move send to vport meta rule creation
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220827/202208271304.MimlzZvl-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=430e2d5e2a982e6f86866762e6d6eb78191f9677
        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 430e2d5e2a982e6f86866762e6d6eb78191f9677
        # 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/ drivers/net/ethernet/mellanox/mlxsw/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:481:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (IS_ERR(flow_rule)) {
               ^~~~~~~~~~~~~~~~~
   drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:489:9: note: uninitialized use occurs here
           return err;
                  ^~~
   drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:481:2: note: remove the 'if' if its condition is always true
           if (IS_ERR(flow_rule)) {
           ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:474:9: note: initialize the variable 'err' to silence this warning
           int err;
                  ^
                   = 0
   1 warning generated.


vim +481 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

   465	
   466	static int
   467	mlx5e_rep_add_meta_tunnel_rule(struct mlx5e_priv *priv)
   468	{
   469		struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
   470		struct mlx5e_rep_priv *rpriv = priv->ppriv;
   471		struct mlx5_eswitch_rep *rep = rpriv->rep;
   472		struct mlx5_flow_handle *flow_rule;
   473		struct mlx5_flow_group *g;
   474		int err;
   475	
   476		g = esw->fdb_table.offloads.send_to_vport_meta_grp;
   477		if (!g)
   478			return 0;
   479	
   480		flow_rule = mlx5_eswitch_add_send_to_vport_meta_rule(esw, rep->vport);
 > 481		if (IS_ERR(flow_rule)) {
   482			err = PTR_ERR(flow_rule);
   483			goto out;
   484		}
   485	
   486		rpriv->send_to_vport_meta_rule = flow_rule;
   487	
   488	out:
   489		return err;
   490	}
   491	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


                 reply	other threads:[~2022-08-27  5:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202208271304.MimlzZvl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=maord@nvidia.com \
    --cc=mbloch@nvidia.com \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox