54df86
From e4d9c795dfe2d6737c777a265292864da98dae8f Mon Sep 17 00:00:00 2001
54df86
From: Reid Wahl <nrwahl@protonmail.com>
54df86
Date: Thu, 30 Jun 2022 14:40:31 -0700
54df86
Subject: [PATCH] Low: Always null-check result in stonith__rhcs_get_metadata
54df86
54df86
Null-check result even if rc == 0.
54df86
54df86
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
54df86
---
54df86
 lib/fencing/st_rhcs.c | 8 +++++---
54df86
 1 file changed, 5 insertions(+), 3 deletions(-)
54df86
54df86
diff --git a/lib/fencing/st_rhcs.c b/lib/fencing/st_rhcs.c
54df86
index 029c97eea..dfccff2cb 100644
54df86
--- a/lib/fencing/st_rhcs.c
54df86
+++ b/lib/fencing/st_rhcs.c
54df86
@@ -132,9 +132,11 @@ stonith__rhcs_get_metadata(const char *agent, int timeout, xmlNode **metadata)
54df86
     int rc = stonith__execute(action);
54df86
     result = stonith__action_result(action);
54df86
 
54df86
-    if (rc < 0 && result == NULL) {
54df86
-        crm_warn("Could not execute metadata action for %s: %s "
54df86
-                 CRM_XS " rc=%d", agent, pcmk_strerror(rc), rc);
54df86
+    if (result == NULL) {
54df86
+        if (rc < 0) {
54df86
+            crm_warn("Could not execute metadata action for %s: %s "
54df86
+                     CRM_XS " rc=%d", agent, pcmk_strerror(rc), rc);
54df86
+        }
54df86
         stonith__destroy_action(action);
54df86
         return rc;
54df86
     }
54df86
-- 
54df86
2.31.1
54df86