From 7e7fd3595e3ee7e260df4566edf5e1ac95fddd82 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Mon, 19 Feb 2018 20:45:02 +0530 Subject: md-cache: Fix coverity issue FORWARD_NULL Change-Id: I6ace846c412d898c0bc024b5d2081b11a223372f Signed-off-by: Poornima G --- xlators/performance/md-cache/src/md-cache.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 9a6a4e4a291..bbfe2e86eb0 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -986,7 +986,7 @@ mdc_load_statfs_info_from_cache (xlator_t *this, struct statvfs **buf) /* Skip if the cache is not initialized */ if (!conf->statfs_cache.initialized) { ret = -1; - goto err; + goto unlock; } timespec_now (&now); @@ -1002,13 +1002,14 @@ mdc_load_statfs_info_from_cache (xlator_t *this, struct statvfs **buf) "Cache age %lf exceeded timeout %d", cache_age, conf->timeout); ret = -1; - goto err; + goto unlock; } *buf = &conf->statfs_cache.buf; } -err: +unlock: pthread_mutex_unlock (&conf->statfs_cache.lock); +err: return ret; } -- cgit