Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx4_en: Remove the redundant NULL check for the 'my_ets' object

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>

authored by

Andrey Vatoropin and committed by
Paolo Abeni
f6be1f29 757639ac

-3
-3
drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
··· 290 290 struct mlx4_en_priv *priv = netdev_priv(dev); 291 291 struct ieee_ets *my_ets = &priv->ets; 292 292 293 - if (!my_ets) 294 - return -EINVAL; 295 - 296 293 ets->ets_cap = IEEE_8021QAZ_MAX_TCS; 297 294 ets->cbs = my_ets->cbs; 298 295 memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw));