netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cosmin Ratiu <cratiu@nvidia.com>
To: Tariq Toukan <tariqt@nvidia.com>,
	"dan.carpenter@linaro.org" <dan.carpenter@linaro.org>,
	"leon@kernel.org" <leon@kernel.org>
Cc: Paul Blakey <paulb@nvidia.com>, Vlad Buslov <vladbu@nvidia.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Chris Mi <cmi@nvidia.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [bug report] net/mlx5e: Implement CT entry update
Date: Mon, 24 Jun 2024 11:18:31 +0000	[thread overview]
Message-ID: <5b69b639df7dc88103f5d8c6fbeaa00b62c27c6d.camel@nvidia.com> (raw)
In-Reply-To: <20240624110915.GF29266@unreal>

On Mon, 2024-06-24 at 14:09 +0300, Leon Romanovsky wrote:
> On Thu, Jun 20, 2024 at 11:50:33AM +0300, Dan Carpenter wrote:
> > Hello Vlad Buslov,
> > 
> > Commit 94ceffb48eac ("net/mlx5e: Implement CT entry update") from Dec
> > 1, 2022 (linux-next), leads to the following Smatch static checker
> > warning:
> > 
> > 	drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c:1163 mlx5_tc_ct_entry_replace_rules()
> > 	error: uninitialized symbol 'err'.
> 
> This error was introduced by the patch 49d37d05f216 ("net/mlx5: CT: Separate CT and CT-NAT tuple entries")
> https://lore.kernel.org/all/20240613210036.1125203-3-tariqt@nvidia.com/

Yes, Leon is correct.
We also caught the error in our static checker runs but the patch was
already sent to net-next before we could alter it with the fix.

> > drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
> >     1142 static int
> >     1143 mlx5_tc_ct_entry_replace_rules(struct mlx5_tc_ct_priv *ct_priv,
> >     1144                                struct flow_rule *flow_rule,
> >     1145                                struct mlx5_ct_entry *entry,
> >     1146                                u8 zone_restore_id)
> >     1147 {
> >     1148         int err;
> >     1149 
> >     1150         if (mlx5_tc_ct_entry_in_ct_table(entry)) {
> >     1151                 err = mlx5_tc_ct_entry_replace_rule(ct_priv, flow_rule, entry, false,
> >     1152                                                     zone_restore_id);
> >     1153                 if (err)
> >     1154                         return err;
> >     1155         }
> >     1156 
> >     1157         if (mlx5_tc_ct_entry_in_ct_nat_table(entry)) {
> >     1158                 err = mlx5_tc_ct_entry_replace_rule(ct_priv, flow_rule, entry, true,
> >     1159                                                     zone_restore_id);
> >     1160                 if (err && mlx5_tc_ct_entry_in_ct_table(entry))
> >     1161                         mlx5_tc_ct_entry_del_rule(ct_priv, entry, false);
> >     1162         }
> > 
> > Can the entry not be in either table?
> > 
> > --> 1163         return err;
> > 
> > If so then err is uninitialized.

In practice, the entry will definitely be in at least one of the tables
(if not both), so the uninitialized err will never happen in practice.
Regardless, to fix the noise, there's a patch already pending
upstreaming, about to be sent by Tariq soon.

Cosmin.

      reply	other threads:[~2024-06-24 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <74076270-8658-4773-aeac-e99d11acea7b@moroto.mountain>
2024-06-24 11:09 ` [bug report] net/mlx5e: Implement CT entry update Leon Romanovsky
2024-06-24 11:18   ` Cosmin Ratiu [this message]

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=5b69b639df7dc88103f5d8c6fbeaa00b62c27c6d.camel@nvidia.com \
    --to=cratiu@nvidia.com \
    --cc=cmi@nvidia.com \
    --cc=dan.carpenter@linaro.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulb@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=vladbu@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;
as well as URLs for NNTP newsgroup(s).