From 273a33174a35d31b7d56f99a9ce2a958d1ef3b17 Mon Sep 17 00:00:00 2001
From: liuhao <liuhao27@huawei.com>
Date: Tue, 22 Jan 2019 11:25:45 +0800
Subject: [PATCH 051/131] if ocihook is empty

return success

Signed-off-by: liuhao <liuhao27@huawei.com>
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
 src/lxc/conf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 48e31aff..6ea8f9c1 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -4782,9 +4782,12 @@ static int run_oci_hooks(const char *name, const char *lxcpath, struct lxc_conf
 	int ret = 0;
 	char *rootpath;
 
-	if (!lc || !lc->ocihooks) {
+	if (!lc) {
 		return -1;
 	}
+	if (!lc->ocihooks) {
+		return 0;
+	}
 
 	rootpath = get_root_path(lc->rootfs.path, lc->rootfs.bdev_type);
 	if (!rootpath) {
-- 
2.23.0

