Merge pull request #643 from mmichal10/use-after-free-fix

Fix `use after free` bug
This commit is contained in:
Robert Baldyga 2021-01-20 11:38:05 +01:00 committed by GitHub
commit 59558a8ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1984,9 +1984,10 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
context->rollback_thread = kthread_create(cache_start_rollback, context,
"cas_cache_rollback_complete");
if (IS_ERR(context->rollback_thread)) {
result = PTR_ERR(context->rollback_thread);
kfree(context);
module_put(THIS_MODULE);
return PTR_ERR(context->rollback_thread);
return result;
}
context->device_cfg = device_cfg;