gpt-auto-generator: fix error propagation in add_root_mount()

When generator_write_initrd_root_device_deps() fails, the error was
swallowed by returning 0 (success) instead of r. The two subsequent
calls in the same block correctly return r on failure.

Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
Co-developed-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongshengyuan
2026-06-16 10:26:23 +02:00
committed by Daan De Meyer
parent cfed283b9c
commit f50ac21ceb
+1 -1
View File
@@ -882,7 +882,7 @@ static int add_root_mount(void) {
if (in_initrd()) {
r = generator_write_initrd_root_device_deps(arg_dest_late, bdev);
if (r < 0)
return 0;
return r;
r = add_root_cryptsetup();
if (r < 0)