cgroup-util: assert on attribute for cg_{get,set}_attribute()

It makes zero sense to ever perform IO operations on cgroup dirs.
This commit is contained in:
Mike Yuan
2025-05-27 14:31:06 +02:00
parent 606ef91a40
commit a941822d1c
+4
View File
@@ -1594,6 +1594,8 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri
_cleanup_free_ char *p = NULL;
int r;
assert(attribute);
r = cg_get_path(controller, path, attribute, &p);
if (r < 0)
return r;
@@ -1605,6 +1607,8 @@ int cg_get_attribute(const char *controller, const char *path, const char *attri
_cleanup_free_ char *p = NULL;
int r;
assert(attribute);
r = cg_get_path(controller, path, attribute, &p);
if (r < 0)
return r;