diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-12-28 09:56:20 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-12-31 06:45:17 +0000 |
commit | 63088d8225df025e03a0ea0a0d8fdc3e8e9b9b08 (patch) | |
tree | ce0523da61aeafb3e70bf24ebc7783621aafbd70 /xlators/mount | |
parent | 3ce7b5dbf069e7bf09c3470753c21efe03339291 (diff) |
multiple-files: clang-scan fixes
updates: bz#1622665
Change-Id: I9f3a75ed9be3d90f37843a140563c356830ef945
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/mount')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index a5135df30ac..d81db2e8c75 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -2339,7 +2339,9 @@ fuse_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state->loc2.parent ? uuid_utoa(state->loc2.parent->gfid) : "", state->loc.inode ? uuid_utoa(state->loc.inode->gfid) : ""); - if (op_ret == 0) { + /* need to check for loc->parent to keep clang-scan happy. + It gets dereferenced below, and is checked for NULL above. */ + if ((op_ret == 0) && (state->loc.parent) && (state->loc.inode)) { gf_log("glusterfs-fuse", GF_LOG_TRACE, "%" PRIu64 ": %s -> %s => 0 (buf->ia_ino=%" PRIu64 ")", frame->root->unique, state->loc.path, state->loc2.path, @@ -3261,6 +3263,9 @@ fuse_release(xlator_t *this, fuse_in_header_t *finh, void *msg, GET_STATE(this, finh, state); fd = FH_TO_FD(fri->fh); + if (!fd) + goto out; + state->fd = fd; priv = this->private; @@ -3274,10 +3279,11 @@ fuse_release(xlator_t *this, fuse_in_header_t *finh, void *msg, fuse_fd_ctx_destroy(this, state->fd); fd_unref(fd); - state->fd = NULL; - gf_fdptr_put(priv->fdtable, fd); + state->fd = NULL; + +out: send_fuse_err(this, finh, 0); free_fuse_state(state); @@ -3748,6 +3754,8 @@ fuse_releasedir(xlator_t *this, fuse_in_header_t *finh, void *msg, GET_STATE(this, finh, state); state->fd = FH_TO_FD(fri->fh); + if (!state->fd) + goto out; priv = this->private; @@ -3764,6 +3772,7 @@ fuse_releasedir(xlator_t *this, fuse_in_header_t *finh, void *msg, state->fd = NULL; +out: send_fuse_err(this, finh, 0); free_fuse_state(state); |