cgroups: vet parameters

parent 8ab39cf2
......@@ -3597,6 +3597,9 @@ bool cgroup_freeze(const char *name, const char *lxcpath, int timeout)
__do_close int unified_fd = -EBADF;
int ret;
if (is_empty_string(name) || is_empty_string(lxcpath))
return ret_errno(EINVAL);
unified_fd = lxc_cmd_get_cgroup2_fd(name, lxcpath);
if (unified_fd < 0)
return ret_errno(ENOCGROUP2);
......@@ -3614,6 +3617,9 @@ bool cgroup_unfreeze(const char *name, const char *lxcpath, int timeout)
__do_close int unified_fd = -EBADF;
int ret;
if (is_empty_string(name) || is_empty_string(lxcpath))
return ret_errno(EINVAL);
unified_fd = lxc_cmd_get_cgroup2_fd(name, lxcpath);
if (unified_fd < 0)
return ret_errno(ENOCGROUP2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment