From 2acb5325828a68b06b39ab44e6736c6ad4ca3a06 Mon Sep 17 00:00:00 2001 From: Nandaja Varma Date: Wed, 11 Feb 2015 11:29:20 +0530 Subject: fuse: Fixing the coverity issues Coverity CID: 1124806 1124692 Change-Id: I6dcf245ded9796fb42516eca63211d855262c26f BUG: 789278 Signed-off-by: Nandaja Varma Reviewed-on: http://review.gluster.org/9629 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mount/fuse/src/fuse-bridge.c | 5 +++++ xlators/mount/fuse/src/fuse-helpers.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'xlators/mount/fuse') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 9ce1fdee13d..ec5c6f60fad 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -4095,6 +4095,11 @@ fuse_first_lookup (xlator_t *this) dict = dict_new (); frame = create_frame (this, this->ctx->pool); + if (!frame) { + gf_log ("fuse", GF_LOG_ERROR, "failed to create frame"); + return -1; + } + frame->root->type = GF_OP_TYPE_FOP; xl = priv->active_subvol; diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c index 7fc41383c36..a28169a0021 100644 --- a/xlators/mount/fuse/src/fuse-helpers.c +++ b/xlators/mount/fuse/src/fuse-helpers.c @@ -259,16 +259,16 @@ static void get_groups(fuse_private_t *priv, call_frame_t *frame) const gid_list_t *gl; gid_list_t agl; + if (!priv || !priv->gid_cache_timeout) { + frame_fill_groups(frame); + return; + } + if (-1 == priv->gid_cache_timeout) { frame->root->ngrps = 0; return; } - if (!priv->gid_cache_timeout) { - frame_fill_groups(frame); - return; - } - gl = gid_cache_lookup(&priv->gid_cache, frame->root->pid, frame->root->uid, frame->root->gid); if (gl) { @@ -326,7 +326,7 @@ get_call_frame_for_req (fuse_state_t *state) state->lk_owner); } - get_groups(priv, frame); + get_groups(priv, frame); if (priv && priv->client_pid_set) frame->root->pid = priv->client_pid; -- cgit