Commit dfe6fd72 authored by Saeed Mahameed's avatar Saeed Mahameed

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: c71ad41c ("net/mlx5: FW tracer, events handling")
Reported-by: default avatarPavel Machek (CIP) <pavel@denx.de>
Suggested-by: default avatarPavel Machek (CIP) <pavel@denx.de>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Reviewed-by: default avatarAya Levin <ayal@nvidia.com>
parent da8252d5
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment