net/mlx5e: Removed useless code in function
authorRustam Subkhankulov <subkhankulov@ispras.ru>
Mon, 11 Jul 2022 09:33:03 +0000 (12:33 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 13 Jul 2022 22:56:48 +0000 (15:56 -0700)
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 <subkhankulov@ispras.ru>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c

index ad0d234632a3c9614ae78b46fe7d64d8d2bcf7cb..9466202fd97b87e869e5268d224d9f1fe2b7b9cf 100644 (file)
@@ -742,10 +742,7 @@ mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv,
 
        eth_rule->flow_spec = *fs;
        eth_rule->eth_ft = eth_ft;
-       if (!eth_ft->ft) {
-               err = -EINVAL;
-               goto del_ethtool_rule;
-       }
+
        rule = add_ethtool_flow_rule(priv, eth_rule, eth_ft->ft, fs, rss_context);
        if (IS_ERR(rule)) {
                err = PTR_ERR(rule);