33 lines
899 B
Diff
33 lines
899 B
Diff
|
|
From 269158eb97dc4bd72e77e12ddcab6295ef3f8d01 Mon Sep 17 00:00:00 2001
|
||
|
|
From: "Neil.wrz" <wangrunze13@huawei.com>
|
||
|
|
Date: Thu, 23 Feb 2023 00:12:34 -0800
|
||
|
|
Subject: [PATCH] null ops cause coredump
|
||
|
|
|
||
|
|
---
|
||
|
|
src/lxc/cgroups/isulad_cgfsng.c | 7 +++++++
|
||
|
|
1 file changed, 7 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/src/lxc/cgroups/isulad_cgfsng.c b/src/lxc/cgroups/isulad_cgfsng.c
|
||
|
|
index 6ccff63..dcaa229 100644
|
||
|
|
--- a/src/lxc/cgroups/isulad_cgfsng.c
|
||
|
|
+++ b/src/lxc/cgroups/isulad_cgfsng.c
|
||
|
|
@@ -938,8 +938,15 @@ __cgfsng_ops static inline bool isulad_cgfsng_payload_create(struct cgroup_ops *
|
||
|
|
struct lxc_handler *handler)
|
||
|
|
{
|
||
|
|
int i;
|
||
|
|
+
|
||
|
|
+ if (!ops)
|
||
|
|
+ return ret_set_errno(false, ENOENT);
|
||
|
|
+
|
||
|
|
char *container_cgroup = ops->container_cgroup;
|
||
|
|
|
||
|
|
+ if (!ops->hierarchies)
|
||
|
|
+ return true;
|
||
|
|
+
|
||
|
|
#ifdef HAVE_ISULAD
|
||
|
|
if (ops->no_controller) {
|
||
|
|
DEBUG("no controller found, isgnore isulad_cgfsng_payload_create");
|
||
|
|
--
|
||
|
|
2.25.1
|
||
|
|
|