From: Rustam Subkhankulov Date: Mon, 11 Jul 2022 09:33:03 +0000 (+0300) Subject: net/mlx5e: Removed useless code in function X-Git-Tag: v6.0-rc1~141^2~123^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbf0b4234bdca3ad06264e2edc07c862a6bee036;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c index ad0d234632a3c..9466202fd97b8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c @@ -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);