zero volume->type in ocf_volume_deinit()
After deinitialization of volume there is no need to call back to type ops. Currently we would erroneously call on_deinit() callback multiple times if ocf_volume_deinit() is performed more than once, which we expect to happen and treat as a correct use of API. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
f0f6ff219b
commit
b6587ad622
@ -161,6 +161,7 @@ void ocf_volume_deinit(ocf_volume_t volume)
|
||||
|
||||
env_free(volume->priv);
|
||||
volume->priv = NULL;
|
||||
volume->type = NULL;
|
||||
|
||||
if (volume->uuid_copy && volume->uuid.data) {
|
||||
env_vfree(volume->uuid.data);
|
||||
@ -191,6 +192,7 @@ void ocf_volume_move(ocf_volume_t volume, ocf_volume_t from)
|
||||
from->opened = false;
|
||||
from->priv = NULL;
|
||||
from->uuid.data = NULL;
|
||||
from->type = NULL;
|
||||
}
|
||||
|
||||
int ocf_volume_create(ocf_volume_t *volume, ocf_volume_type_t type,
|
||||
|
Loading…
Reference in New Issue
Block a user