namespace: avoid assertion failure (#6649)
authorTopi Miettinen <topimiettinen@users.noreply.github.com>
Tue, 29 Aug 2017 15:31:24 +0000 (15:31 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 29 Aug 2017 15:31:24 +0000 (17:31 +0200)
If the root image is not decrypted, it must not be relinquished.

src/core/namespace.c

index 3eb171c..09eac6b 100644 (file)
@@ -1063,9 +1063,11 @@ int setup_namespace(
                 if (r < 0)
                         goto finish;
 
-                r = decrypted_image_relinquish(decrypted_image);
-                if (r < 0)
-                        goto finish;
+                if (decrypted_image) {
+                        r = decrypted_image_relinquish(decrypted_image);
+                        if (r < 0)
+                                goto finish;
+                }
 
                 loop_device_relinquish(loop_device);