From: Christian Brauner Date: Mon, 1 Feb 2021 14:20:43 +0000 (+0100) Subject: cgroups: remove pointless NULL checks X-Git-Tag: lxc-5.0.0~310^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb6dbaf0dfbba308cd3e999f6a15a96dcb1bc7c4;p=thirdparty%2Flxc.git cgroups: remove pointless NULL checks We're already ensuring before that conf isn't NULL. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index c06f2ef9a..7e39a8fd7 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1008,7 +1008,7 @@ __cgfsng_ops static void cgfsng_payload_destroy(struct cgroup_ops *ops, WARN("Failed to detach bpf program from cgroup"); #endif - if (handler->conf && !lxc_list_empty(&handler->conf->id_map)) { + if (!lxc_list_empty(&handler->conf->id_map)) { struct generic_userns_exec_data wrap = { .conf = handler->conf, .container_cgroup = ops->container_cgroup, @@ -1069,13 +1069,13 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops, goto try_lxc_rm_rf; } - if (conf && conf->cgroup_meta.monitor_pivot_dir) + if (conf->cgroup_meta.monitor_pivot_dir) pivot_path = must_make_path(h->mountpoint, h->container_base_path, conf->cgroup_meta.monitor_pivot_dir, CGROUP_PIVOT, NULL); - else if (conf && conf->cgroup_meta.monitor_dir) + else if (conf->cgroup_meta.monitor_dir) pivot_path = must_make_path(h->mountpoint, h->container_base_path, conf->cgroup_meta.monitor_dir, CGROUP_PIVOT, NULL); - else if (conf && conf->cgroup_meta.dir) + else if (conf->cgroup_meta.dir) pivot_path = must_make_path(h->mountpoint, h->container_base_path, conf->cgroup_meta.dir, CGROUP_PIVOT, NULL); else