From 9ef8138946362f42111d1a53dfc91c796546ca50 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 18 Feb 2025 22:30:31 +0100 Subject: [PATCH] homework: unify common error handling --- src/home/homework.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/home/homework.c b/src/home/homework.c index 40478232546..7eb42e1dac6 100644 --- a/src/home/homework.c +++ b/src/home/homework.c @@ -932,30 +932,23 @@ static int home_activate(UserRecord *h, UserRecord **ret_home) { case USER_LUKS: r = home_activate_luks(h, flags, &setup, &cache, &new_home); - if (r < 0) - return r; - break; case USER_SUBVOLUME: case USER_DIRECTORY: case USER_FSCRYPT: r = home_activate_directory(h, flags, &setup, &cache, &new_home); - if (r < 0) - return r; - break; case USER_CIFS: r = home_activate_cifs(h, flags, &setup, &cache, &new_home); - if (r < 0) - return r; - break; default: assert_not_reached(); } + if (r < 0) + return r; /* Note that the returned object might either be a reference to an updated version of the existing * home object, or a reference to a newly allocated home object. The caller has to be able to deal -- 2.47.3