From a4d073cda22787552b46b186b898304b438db0c2 Mon Sep 17 00:00:00 2001 From: Barak Sason Date: Sun, 18 Aug 2019 12:21:47 +0300 Subject: protocol/client - fixing a coverity issue Moved null pointer check up in order to avoid seg-fault CID: 1404258 Updates: bz#789278 Change-Id: Ib97e05302bfeb8fe38d6ce9870b9740cb576e492 Signed-off-by: Barak Sason --- xlators/protocol/client/src/client-handshake.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/protocol/client/src/client-handshake.c') diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 55a03716ddc..649b113db14 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -621,13 +621,13 @@ __is_fd_reopen_in_progress(clnt_fd_ctx_t *fdctx) void client_attempt_reopen(fd_t *fd, xlator_t *this) { + if (!fd || !this) + goto out; + clnt_conf_t *conf = this->private; clnt_fd_ctx_t *fdctx = NULL; gf_boolean_t reopen = _gf_false; - if (!fd || !this) - goto out; - pthread_spin_lock(&conf->fd_lock); { fdctx = this_fd_get_ctx(fd, this); -- cgit