]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx4_en: Remove the redundant NULL check for the 'my_ets' object
authorAndrey Vatoropin <a.vatoropin@crpt.ru>
Mon, 16 Jun 2025 04:50:44 +0000 (04:50 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 19 Jun 2025 09:53:07 +0000 (11:53 +0200)
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@crpt.ru>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250616045034.26000-1-a.vatoropin@crpt.ru
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c

index 752a72499b4f16ebb22c126c258ca35a0f19619d..be80da03a5945698623a6d4b461359a681e68e91 100644 (file)
@@ -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));