All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	Tariq Toukan <tariqt@nvidia.com>
Cc: Vlad Buslov <vladbu@nvidia.com>,
	linux-rdma@vger.kernel.org, linux-netdev <netdev@vger.kernel.org>,
	Paul Blakey <paulb@nvidia.com>, Chris Mi <cmi@nvidia.com>
Subject: Re: [bug report] net/mlx5e: Implement CT entry update
Date: Mon, 24 Jun 2024 14:09:15 +0300	[thread overview]
Message-ID: <20240624110915.GF29266@unreal> (raw)
In-Reply-To: <74076270-8658-4773-aeac-e99d11acea7b@moroto.mountain>

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/

Thanks

> 
> 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.
> 
>     1164 }
> 
> regards,
> dan carpenter
> 

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20  8:50 [bug report] net/mlx5e: Implement CT entry update Dan Carpenter
2024-06-24 11:09 ` Leon Romanovsky [this message]
2024-06-24 11:18   ` Cosmin Ratiu

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=20240624110915.GF29266@unreal \
    --to=leon@kernel.org \
    --cc=cmi@nvidia.com \
    --cc=dan.carpenter@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.