From 8df155bf0ff10574adbf06cc9383916a1ff4c932 Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Sat, 4 Nov 2017 19:48:48 +0530 Subject: cluster/dht: Check for NULL local before using it Coverity ID: 261 Coverity ID: 257 Check if local is NULL or not Change-Id: I570f87f32e1347f891c6a02ee5641fcc5a262a96 BUG: 789278 Signed-off-by: Ashish Pandey --- xlators/cluster/dht/src/dht-selfheal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index faf5ddb8aa3..78d8b6a5f6c 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -233,7 +233,9 @@ unlock: return 0; err: - local->refresh_layout_unlock (frame, this, -1, 1); + if (local) { + local->refresh_layout_unlock (frame, this, -1, 1); + } return 0; } @@ -309,7 +311,9 @@ dht_refresh_layout (call_frame_t *frame) return 0; out: - local->refresh_layout_unlock (frame, this, -1, 1); + if (local) { + local->refresh_layout_unlock (frame, this, -1, 1); + } return 0; } -- cgit