Skip to content

Commit bbf0b42

Browse files
RustamSubkhankulovSaeed Mahameed
authored andcommitted
net/mlx5e: Removed useless code in function
Comparison of eth_ft->ft with NULL is useless, because get_flow_table() returns either pointer 'eth_ft' such that eth_ft->ft != NULL, or an erroneous value that is handled on return, causing mlx5e_ethtool_flow_replace() to terminate before checking whether eth_ft->ft equals NULL. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Rustam Subkhankulov <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 9c0ca9b commit bbf0b42

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,7 @@ mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv,
742742

743743
eth_rule->flow_spec = *fs;
744744
eth_rule->eth_ft = eth_ft;
745-
if (!eth_ft->ft) {
746-
err = -EINVAL;
747-
goto del_ethtool_rule;
748-
}
745+
749746
rule = add_ethtool_flow_rule(priv, eth_rule, eth_ft->ft, fs, rss_context);
750747
if (IS_ERR(rule)) {
751748
err = PTR_ERR(rule);

0 commit comments

Comments
 (0)