From patchwork Mon Oct 24 16:59:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13017940 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE557C38A2D for ; Mon, 24 Oct 2022 18:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbiJXSVs (ORCPT ); Mon, 24 Oct 2022 14:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231422AbiJXSVF (ORCPT ); Mon, 24 Oct 2022 14:21:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79E3BD03BD for ; Mon, 24 Oct 2022 10:02:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A5A0FB81597 for ; Mon, 24 Oct 2022 17:00:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5618C433D7; Mon, 24 Oct 2022 17:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666630822; bh=5f/vo3lD4aj6GUVNDP2M0RaiddL1sztGtnfA3jea7TQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HLYZbpPWD0n/+8JkcguWKs4jQ87a1hivxosKQF+qUuFa83AeLzzPxb6lWIOxeTR23 t9X5Rkov7rRMQXQK7OoUNl3ZShj0LDDyVb5/bgpfieXu47swKMMsn0qe7H1JmKOML+ PukK5xDf7Yx0NladGB7sM/CmCEP++FE9mGIx0VTxlcsjPYaaeb3uXmbpF7roftH16H 9Z3/7rMF1y/hv1Hn6EXZ3jAYZa9b5rqH7ONBDuX8DycsFlg6GTUvNOb19DAoGeF1N7 BkGaMwIIWh371/uoFZDhROTrUSaVnkao+PorYM5JwSQ6R+CBm4F5uRPiMkjsIdq0qF p95hifgaCiGlA== From: Leon Romanovsky To: "David S . Miller" , Jakub Kicinski Cc: Leon Romanovsky , Eric Dumazet , netdev@vger.kernel.org, Paolo Abeni , Saeed Mahameed Subject: [PATCH net-next v1 5/6] net/mlx5: Remove redundant check Date: Mon, 24 Oct 2022 19:59:58 +0300 Message-Id: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Leon Romanovsky If ASO failed in creation, it won't be called to destroy either. The kernel coding pattern is to make sure that callers are calling to destroy only for valid objects. Signed-off-by: Leon Romanovsky --- drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c index 88655d5746d6..87605f142a20 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c @@ -327,9 +327,6 @@ struct mlx5_aso *mlx5_aso_create(struct mlx5_core_dev *mdev, u32 pdn) void mlx5_aso_destroy(struct mlx5_aso *aso) { - if (IS_ERR_OR_NULL(aso)) - return; - mlx5_aso_destroy_sq(aso); mlx5_aso_destroy_cq(&aso->cq); kfree(aso);