diff options
author | Saeed Mahameed <saeedm@nvidia.com> | 2021-08-18 13:09:26 -0700 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2021-09-07 14:16:52 -0700 |
commit | dfe6fd72b5f1878b16aa2c8603e031bbcd66b96d (patch) | |
tree | 1767c35d456883d58525cb72c92f22cc95c19361 /drivers/net | |
parent | da8252d5805d4a80120a0c2151277e5fb9e8aa9e (diff) | |
download | linux-stable-dfe6fd72b5f1878b16aa2c8603e031bbcd66b96d.tar.gz linux-stable-dfe6fd72b5f1878b16aa2c8603e031bbcd66b96d.tar.bz2 linux-stable-dfe6fd72b5f1878b16aa2c8603e031bbcd66b96d.zip |
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")
Reported-by: Pavel Machek (CIP) <pavel@denx.de>
Suggested-by: Pavel Machek (CIP) <pavel@denx.de>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Aya Levin <ayal@nvidia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 @@ err_notifier_unregister: 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; } |