mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Do not reinitialize dm backend when not needed.
device-mapper backend gets initialized with crypt_device structure and it cannot be NULL in crypt_suspend.
This commit is contained in:
@@ -3864,14 +3864,12 @@ int crypt_suspend(struct crypt_device *cd,
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
ci = crypt_status(NULL, name);
|
||||
ci = crypt_status(cd, name);
|
||||
if (ci < CRYPT_ACTIVE) {
|
||||
log_err(cd, _("Volume %s is not active."), name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dm_backend_init(cd);
|
||||
|
||||
r = dm_status_suspended(cd, name);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
@@ -3897,7 +3895,6 @@ int crypt_suspend(struct crypt_device *cd,
|
||||
crypt_drop_keyring_key_by_description(cd, key_desc, LOGON_KEY);
|
||||
free(key_desc);
|
||||
out:
|
||||
dm_backend_exit(cd);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user