homework: explicitly close cryptsetup context, to not keep loopback device busy

The cryptsetup context pins the loop device even after deactivation.
Let's explicitly release the context to make sure the subsequent
loopback device detaching works cleanly.
This commit is contained in:
Lennart Poettering 2020-08-17 22:09:04 +02:00
parent 6d7b47eb3e
commit df14bda2b5
1 changed files with 3 additions and 0 deletions

View File

@ -2166,6 +2166,9 @@ int home_create_luks(
goto fail;
}
crypt_free(cd);
cd = NULL;
dm_activated = false;
loop = loop_device_unref(loop);