Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3174982imw; Mon, 11 Jul 2022 03:34:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ui692r/J3f2hT22r4bJTK1boYnnT7gK5RjOIDMW0Sva+yTSPyF+h4VTACyS6XmBwAnH5i5 X-Received: by 2002:a17:907:72c7:b0:722:f046:c9d9 with SMTP id du7-20020a17090772c700b00722f046c9d9mr17635121ejc.409.1657535650693; Mon, 11 Jul 2022 03:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657535650; cv=none; d=google.com; s=arc-20160816; b=UsUlNedvrWDEjRjnMEO8fQp7txPjUYQPWE0QODPnkMQxuQaC4v4C7DkSNE3T0+XRoV IjrOGI29VI/WYcjbyYA5p+vGW9iBCJD9PsQv9PZidrdZCNCyOl0dQKo1bXpii/QfE5sZ HZFHa8LqmFnFj/9UBnaPpl1typqbPA4grhps3xDB6TJYRJcmstNtb518zm5vc5ZnsOGz 7i/pLb/Nq1+snVYsQV53PUJyzxOgz8KHfL2Pq2mYNhOvjwjgrYgn7AtD0meincihY3nj lw54fHO+47w2h6K72y0SlVXYcwY3l148zipigXXMjbCSMuJkGKxCV5I3ZJYlX1jmiN1c Y+pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=cz2Ad1Xt3r8CxcKelo+XG/SSPpmgFZX8guzF2Eg+eds=; b=LwiBBIHhECN27nMiyR7MzeFRwpQdF5EJViTKqh8Z3udxgnR+0krPLjiIaCbF1Bh1vE VyF1SvGhxvgWSsUbvQsnnNi0lREOuAfW3b+wiOF+O4VF82HRFZzILrHLADTbyZTgGBTO G+Qn8H44h6NtT6WWZgK5KhDncZJIbme7L4BXnvrQoFXtPjrYgItWpXkpT427lXbvIjB7 HgHPnRknduJnKGpf5AzZJq0tuiglwgBLfsnqa3wjkTwE6x0PXFRTakSf0Nc2LsREEyAE GEC1iCgqNkIXmIP9SqqUp43RtZf3VUNjA7n4u6U4YlydegywBA8+Ux71p5Q94Hu0lk10 bifQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b23-20020aa7cd17000000b0043a90a31070si8377552edw.284.2022.07.11.03.33.46; Mon, 11 Jul 2022 03:34:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234628AbiGKKMA (ORCPT + 99 others); Mon, 11 Jul 2022 06:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231411AbiGKKKd (ORCPT ); Mon, 11 Jul 2022 06:10:33 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 150C9BCB6; Mon, 11 Jul 2022 02:33:17 -0700 (PDT) Received: from rustam-GF63-Thin-9RCX.intra.ispras.ru (unknown [83.149.199.65]) by mail.ispras.ru (Postfix) with ESMTPS id 692F740737A7; Mon, 11 Jul 2022 09:33:11 +0000 (UTC) From: Rustam Subkhankulov To: Saeed Mahameed Cc: Rustam Subkhankulov , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maor Gottlieb , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov Subject: [PATCH] net/mlx5e: Removed useless code in function Date: Mon, 11 Jul 2022 12:33:03 +0300 Message-Id: <20220711093303.14511-1-subkhankulov@ispras.ru> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Fixes: 6dc6071cfcde ("net/mlx5e: Add ethtool flow steering support") --- drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 ad0d234632a3..9466202fd97b 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); -- 2.25.1