summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-handshake.c
diff options
context:
space:
mode:
authorBarak Sason <bsasonro@redhat.com>2019-08-18 12:21:47 +0300
committerAmar Tumballi <amarts@gmail.com>2019-08-20 04:04:04 +0000
commita4d073cda22787552b46b186b898304b438db0c2 (patch)
tree8bf662206e3e8a8f43b642bd58c2980b9725e96b /xlators/protocol/client/src/client-handshake.c
parent0590a1e5dd339af716ed49f0e66f3281ec7a6d0e (diff)
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 <bsasonro@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client-handshake.c')
-rw-r--r--xlators/protocol/client/src/client-handshake.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index 55a0371..649b113 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);