[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4e3e501e-d89b-4eec-afa1-3ec78d5a6527@intel.com>
Date: Mon, 16 Jun 2025 15:11:34 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Ваторопин Андрей
<a.vatoropin@...t.ru>, Tariq Toukan <tariqt@...dia.com>
CC: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "linux-rdma@...r.kernel.org"
<linux-rdma@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "lvc-project@...uxtesting.org"
<lvc-project@...uxtesting.org>
Subject: Re: [PATCH net-next] net/mlx4_en: Remove the redundant NULL check for
the 'my_ets' object
On 6/15/2025 9:50 PM, Ваторопин Андрей wrote:
> From: Andrey Vatoropin <a.vatoropin@...t.ru>
>
> Static analysis shows that pointer "my_ets" cannot be NULL because it
> points to the object "struct ieee_ets".
>
> Remove the extra NULL check. It is meaningless and harms the readability
> of the code.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Andrey Vatoropin <a.vatoropin@...t.ru>
> Reviewed-by: Tariq Toukan <tariqt@...dia.com>
> ---
> Resend for net-next. Link to initial thread:
> https://lore.kernel.org/netdev/20250401061439.9978-1-a.vatoropin@crpt.ru/
> drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> index 752a72499b4f..be80da03a594 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> @@ -290,9 +290,6 @@ static int mlx4_en_dcbnl_ieee_getets(struct net_device *dev,
> struct mlx4_en_priv *priv = netdev_priv(dev);
> struct ieee_ets *my_ets = &priv->ets;
>
> - if (!my_ets)
> - return -EINVAL;
> -
> ets->ets_cap = IEEE_8021QAZ_MAX_TCS;
> ets->cbs = my_ets->cbs;
> memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw));
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Powered by blists - more mailing lists