summaryrefslogtreecommitdiffstats
path: root/xlators/debug/io-stats/src/io-stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/debug/io-stats/src/io-stats.c')
-rw-r--r--xlators/debug/io-stats/src/io-stats.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index 06a16c8f3e6..29c9af6f3c5 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -3450,12 +3450,13 @@ io_stats_release(xlator_t *this, fd_t *fd)
BUMP_FOP(RELEASE);
conf = this->private;
-
- LOCK(&conf->lock);
- {
- conf->cumulative.nr_opens--;
+ if (conf) {
+ LOCK(&conf->lock);
+ {
+ conf->cumulative.nr_opens--;
+ }
+ UNLOCK(&conf->lock);
}
- UNLOCK(&conf->lock);
ios_fd_ctx_get(fd, this, &iosfd);
if (iosfd) {