From: Christian Brauner Date: Wed, 15 Apr 2020 09:56:54 +0000 (+0200) Subject: cgroups: do not pass NULL pointer X-Git-Tag: lxc-5.0.0~451^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83b25c4d371676bbdf164f14227ab9260a8ad530;p=thirdparty%2Flxc.git cgroups: do not pass NULL pointer Fixes: Coverity 1461752. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index a6ee6875e..cabc39fb3 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2736,6 +2736,9 @@ static int device_cgroup_rule_parse_devpath(struct device_item *device, return ret_set_errno(-1, EINVAL); } + if (!mode) + return ret_errno(EINVAL); + if (device_cgroup_parse_access(device, mode) < 0) return -1;