]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homework: unify common error handling
authorLennart Poettering <lennart@poettering.net>
Tue, 18 Feb 2025 21:30:31 +0000 (22:30 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Feb 2025 17:13:18 +0000 (18:13 +0100)
src/home/homework.c

index 404782325462e1aecd346a90ce0900f3193f5ff4..7eb42e1dac6f98382b3d3f31cd727c798a471ffc 100644 (file)
@@ -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