Merge pull request #1248 from kmajzero/null_pointer_deref_fix_1235

Fix for null pointer dereference bug
This commit is contained in:
Robert Baldyga 2022-06-24 12:28:06 +02:00 committed by GitHub
commit 23cb6b5df4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -2946,7 +2946,7 @@ int cache_mngt_exit_instance(const char *cache_name, size_t name_len, int flush)
goto stop_thread;
}
} else {
status = kcas_cache_destroy_exported_object(cache);
status = cache_mngt_destroy_cache_exp_obj(cache);
if (status != 0) {
printk(KERN_WARNING
"Failed to remove cache exported object\n");

View File

@ -571,9 +571,14 @@ end:
static int kcas_volume_destroy_exported_object(ocf_volume_t volume)
{
struct bd_object *bvol = bd_object(volume);
struct bd_object *bvol;
int result;
BUG_ON(!volume);
bvol = bd_object(volume);
BUG_ON(!bvol);
if (!bvol->expobj_valid)
return 0;