Close all device handlers after failed internal load.

This commit is contained in:
Ondrej Kozina
2019-05-24 16:13:07 +02:00
parent e92e320956
commit cd1fe75987

View File

@@ -1169,6 +1169,8 @@ static int _init_by_name_crypt(struct crypt_device *cd, const char *name)
if (r < 0) {
log_dbg(cd, "LUKS device header does not match active device.");
crypt_set_null_type(cd);
device_close(cd, cd->metadata_device);
device_close(cd, cd->device);
r = 0;
goto out;
}