From patchwork Tue Sep 7 21:24:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12479375 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 X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52F46C433F5 for ; Tue, 7 Sep 2021 21:24:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3745461090 for ; Tue, 7 Sep 2021 21:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234972AbhIGVZs (ORCPT ); Tue, 7 Sep 2021 17:25:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:37668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347247AbhIGVZg (ORCPT ); Tue, 7 Sep 2021 17:25:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D738D61130; Tue, 7 Sep 2021 21:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631049870; bh=pFCQ+FRkZbr1qRhGa4oabcBHLAxXb/EWSj9Ty+3xSg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H1em3rVXXvAmVv+9zJShdVSa9ET++4Y+G2xE0S45keVxcMpB8NN37Nl2tciNqt2RB fZMutUD+/bRWogsoJmMLbK4GtzvVV/DUpeS6HuuEMktKmO+A5cxPmiH9YMZwGKwrxN E3ng9Ks4JIbPCFsGfjx632gxltrYvZ6FR7tKtCR9Uy86LDwnIHaLktBFfVNDurUwZJ mPul//079ntf9zwxSgVJl1CjmLVqqaO2S6eHLnoCzSRYZo2D90sssD7yBySJlzx3Qj CIo6WMjoFxHUHJMMfVqzYy0iA6YMY6VmvnuILb8FAIr33Q2qndNgc1Nqe4I1eHq84n 0rFqbMNmpFYig== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Saeed Mahameed , Pavel Machek , Aya Levin Subject: [net 4/7] net/mlx5: FWTrace, cancel work on alloc pd error flow Date: Tue, 7 Sep 2021 14:24:17 -0700 Message-Id: <20210907212420.28529-5-saeed@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907212420.28529-1-saeed@kernel.org> References: <20210907212420.28529-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Saeed Mahameed Handle error flow on mlx5_core_alloc_pd() failure, read_fw_strings_work must be canceled. Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling") Reported-by: Pavel Machek (CIP) Suggested-by: Pavel Machek (CIP) Signed-off-by: Saeed Mahameed Reviewed-by: Aya Levin Reviewed-by: Pavel Machek (CIP) --- drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c index 3f8a98093f8c..f9cf9fb31547 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c @@ -1007,7 +1007,7 @@ int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer) err = mlx5_core_alloc_pd(dev, &tracer->buff.pdn); if (err) { mlx5_core_warn(dev, "FWTracer: Failed to allocate PD %d\n", err); - return err; + goto err_cancel_work; } err = mlx5_fw_tracer_create_mkey(tracer); @@ -1031,6 +1031,7 @@ int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer) mlx5_core_destroy_mkey(dev, &tracer->buff.mkey); err_dealloc_pd: mlx5_core_dealloc_pd(dev, tracer->buff.pdn); +err_cancel_work: cancel_work_sync(&tracer->read_fw_strings_work); return err; }