tree-wide: use dissected_image_relinquish()

This commit is contained in:
Yu Watanabe
2022-09-18 23:47:20 +09:00
parent f906075a15
commit 3044d343dd
4 changed files with 24 additions and 52 deletions
+5 -10
View File
@@ -2003,7 +2003,6 @@ int setup_namespace(
char **error_path) {
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
_cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL;
_cleanup_(dissected_image_unrefp) DissectedImage *dissected_image = NULL;
_cleanup_(verity_settings_done) VeritySettings verity = VERITY_SETTINGS_DEFAULT;
_cleanup_strv_free_ char **hierarchies = NULL;
@@ -2084,7 +2083,7 @@ int setup_namespace(
NULL,
&verity,
dissect_image_flags,
&decrypted_image);
NULL);
if (r < 0)
return log_debug_errno(r, "Failed to decrypt dissected image: %m");
}
@@ -2416,16 +2415,12 @@ int setup_namespace(
goto finish;
}
if (decrypted_image) {
r = decrypted_image_relinquish(decrypted_image);
if (r < 0) {
log_debug_errno(r, "Failed to relinquish decrypted image: %m");
goto finish;
}
r = dissected_image_relinquish(dissected_image);
if (r < 0) {
log_debug_errno(r, "Failed to relinquish dissected image: %m");
goto finish;
}
loop_device_relinquish(loop_device);
} else if (root_directory) {
/* A root directory is specified. Turn its directory into bind mount, if it isn't one yet. */