Detach finish: destroy stop pipeline before cmpl
'stop_pipeline' filed may be reused during cache lifetime (e.g. when cache is detached and attached again - the pipeline would be freed and then re-allocated). Calling completion after detach before freeing the pipeline may lead to race condition. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
parent
283a897eeb
commit
2a97de8792
@ -3754,12 +3754,13 @@ static void ocf_mngt_cache_detach_finish(ocf_pipeline_t pipeline,
|
||||
"Detaching device failed\n");
|
||||
}
|
||||
|
||||
ocf_pipeline_destroy(cache->stop_pipeline);
|
||||
cache->stop_pipeline = NULL;
|
||||
|
||||
context->cmpl(cache, context->priv,
|
||||
error ?: context->cache_write_error);
|
||||
|
||||
ocf_pipeline_destroy(context->pipeline);
|
||||
ocf_pipeline_destroy(cache->stop_pipeline);
|
||||
cache->stop_pipeline = NULL;
|
||||
}
|
||||
|
||||
struct ocf_pipeline_properties ocf_mngt_cache_detach_pipeline_properties = {
|
||||
|
Loading…
Reference in New Issue
Block a user