Skip to contentSkip to conversation

FAILED: patch "[PATCH] net/mlx5: FWTrace, cancel work on alloc pd error flow" failed to apply to 4.19-stable tree

PATCH [email protected] 1 participant 1 message Sep 20, 2021

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From dfe6fd72b5f1878b16aa2c8603e031bbcd66b96d Mon Sep 17 00:00:00 2001
From: Saeed Mahameed <[email protected]>
Date: Wed, 18 Aug 2021 13:09:26 -0700
Subject: [PATCH] net/mlx5: FWTrace, cancel work on alloc pd error flow

Handle error flow on mlx5_core_alloc_pd() failure, read_fw_strings_work must be canceled.

Fixes c71ad41ccb0c ("net/mlx5: FW tracer, events handling")
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +2 -1
index 3f8a98093f8c..f9cf9fb31547 100644
@@ -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;
 }