From b6cfb3f34dc7db66070c80789b917f6d340d5aa1 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 16 Oct 2018 07:17:34 -0700 Subject: [PATCH] rgw: fix chained cache put if cache isn't initialized Signed-off-by: Yehuda Sadeh --- src/rgw/services/svc_sys_obj_cache.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rgw/services/svc_sys_obj_cache.h b/src/rgw/services/svc_sys_obj_cache.h index 71421131e4c..7b986fe5089 100644 --- a/src/rgw/services/svc_sys_obj_cache.h +++ b/src/rgw/services/svc_sys_obj_cache.h @@ -138,6 +138,10 @@ public: bool put(RGWSI_SysObj_Cache *svc, const string& key, T *entry, std::initializer_list cache_info_entries) { + if (!svc) { + return false; + } + Entry chain_entry(this, key, entry); /* we need the svc cache to call us under its lock to maintain lock ordering */ -- 2.39.5