Fix for null pointer dereference bug
Null pointer dereference occurs when terminating cache is standby detached state. This fixes this problem. Fixes #1235 Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
This commit is contained in:
parent
85cbeb997c
commit
2739d83bec
@ -2946,7 +2946,7 @@ int cache_mngt_exit_instance(const char *cache_name, size_t name_len, int flush)
|
|||||||
goto stop_thread;
|
goto stop_thread;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
status = kcas_cache_destroy_exported_object(cache);
|
status = cache_mngt_destroy_cache_exp_obj(cache);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"Failed to remove cache exported object\n");
|
"Failed to remove cache exported object\n");
|
||||||
|
@ -571,9 +571,14 @@ end:
|
|||||||
|
|
||||||
static int kcas_volume_destroy_exported_object(ocf_volume_t volume)
|
static int kcas_volume_destroy_exported_object(ocf_volume_t volume)
|
||||||
{
|
{
|
||||||
struct bd_object *bvol = bd_object(volume);
|
struct bd_object *bvol;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
BUG_ON(!volume);
|
||||||
|
|
||||||
|
bvol = bd_object(volume);
|
||||||
|
BUG_ON(!bvol);
|
||||||
|
|
||||||
if (!bvol->expobj_valid)
|
if (!bvol->expobj_valid)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user