From patchwork Sun Oct 23 17:22:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13016363 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 08912C3A59D for ; Sun, 23 Oct 2022 17:23:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbiJWRXd (ORCPT ); Sun, 23 Oct 2022 13:23:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbiJWRXa (ORCPT ); Sun, 23 Oct 2022 13:23:30 -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 5F0B36EF22 for ; Sun, 23 Oct 2022 10:23:24 -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 B57A7B80BA4 for ; Sun, 23 Oct 2022 17:23:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D67E1C433D6; Sun, 23 Oct 2022 17:23:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666545801; bh=5f/vo3lD4aj6GUVNDP2M0RaiddL1sztGtnfA3jea7TQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qZGTSW5uXd2qXIBaUCmQwRAiv7ppYlmWJ6GbU9Pqat/X91BFp1JSDgK87jR5r3PVi 0wtk66BMFYniyKH3wU/fsIOghyGHyN5EwGg4iGbCaD6pEFr0cCwpZSx7kYgpmW2+b4 8J8ClKv7IEblkL1oauTObabZwV52VLn8hzKCq7h+hOaBJZtancAEY9qgx0fo4goJft qRNtfRO4/B0T6p9NymlhN2JfPfNnZRFBczfKj9kSs6hiBvUYyJyAX/Wz8rY4NBfEqx vx5g3Ta14Fm2/nxbOYHfyEUTlMHXiddnmbaYeL+pfnvo6R4c8DhCK0Z/49kLn4VK5m EdaFlsWEyPmdA== 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 5/6] net/mlx5: Remove redundant check Date: Sun, 23 Oct 2022 20:22:57 +0300 Message-Id: <01b2995cbd049e1cef2b2ba32c25488c51f28b1e.1666545480.git.leonro@nvidia.com> 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);