]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: add an assert to guide static analysis
authorLuca Boccassi <bluca@debian.org>
Thu, 4 Jan 2024 11:44:31 +0000 (12:44 +0100)
committerLuca Boccassi <bluca@debian.org>
Thu, 4 Jan 2024 13:30:20 +0000 (14:30 +0100)
Follow-up for 4fb0d2dc140c9a2c01c236d2a8dc09a44157e896

CID#1533110

src/core/cgroup.c

index e8ba01037ab87582ee0c79df1d743f167cdd55e4..3cd0490255e023f46a4e4540ccd1efebdcba482f 100644 (file)
@@ -4572,7 +4572,7 @@ static uint64_t unit_get_effective_limit_one(Unit *u, CGroupLimitType type) {
                                 assert_not_reached();
                 }
 
-        cc = unit_get_cgroup_context(u);
+        cc = ASSERT_PTR(unit_get_cgroup_context(u));
         switch (type) {
                 /* Note: on legacy/hybrid hierarchies memory_max stays CGROUP_LIMIT_MAX unless configured
                  * explicitly. Effective value of MemoryLimit= (cgroup v1) is not implemented. */