Skip to content

Commit f6be1f2

Browse files
Andrey VatoropinPaolo Abeni
authored andcommitted
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 <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 757639a commit f6be1f2

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,6 @@ static int mlx4_en_dcbnl_ieee_getets(struct net_device *dev,
290290
struct mlx4_en_priv *priv = netdev_priv(dev);
291291
struct ieee_ets *my_ets = &priv->ets;
292292

293-
if (!my_ets)
294-
return -EINVAL;
295-
296293
ets->ets_cap = IEEE_8021QAZ_MAX_TCS;
297294
ets->cbs = my_ets->cbs;
298295
memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw));

0 commit comments

Comments
 (0)