diff options
author | Ravishankar N <ravishankar@redhat.com> | 2014-12-19 16:38:43 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2014-12-23 07:22:38 -0800 |
commit | 0299f7f0f7c4d8e5e7e04d8bc1787ecbee6dbe52 (patch) | |
tree | d810a1f0e17fa7707a0b5191f2604370c57b594e /xlators/cluster/afr/src/afr-inode-read.c | |
parent | 85427a23c238499137cbfaafdb7b6ad27f67506a (diff) |
afr: coverity fixes
Some fixes for the 17th Dec 2014 run.
https://scan6.coverity.com:8443/reports.htm#v31028/p10714/g31029
Change-Id: Ia4410ef87a56fffb61803d0a4e62369b058e1cfb
BUG: 1176089
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/9314
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-read.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-read.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index 210d710a2b3..e64070e1bcd 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -766,7 +766,7 @@ unlock: } len = dict_serialized_length (local->dict); - if (len == 0) { + if (len <= 0) { goto unwind; } @@ -957,7 +957,7 @@ afr_fgetxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, } if (!dict || (op_ret < 0)) - goto out; + goto unlock; if (!local->dict) local->dict = dict_new (); @@ -967,7 +967,7 @@ afr_fgetxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, local->cont.getxattr.name, &xattr); if (ret) - goto out; + goto unlock; xattr = gf_strdup (xattr); @@ -978,14 +978,14 @@ afr_fgetxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, if (ret) { gf_log (this->name, GF_LOG_ERROR, "Cannot set xattr cookie key"); - goto out; + goto unlock; } local->cont.getxattr.xattr_len += strlen (xattr) + 1; } } -out: +unlock: UNLOCK (&frame->lock); if (!callcnt) { @@ -1040,6 +1040,7 @@ out: dict_unref (nxattr); } +out: return ret; } @@ -1080,7 +1081,7 @@ afr_getxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, } if (!dict || (op_ret < 0)) - goto out; + goto unlock; if (!local->dict) local->dict = dict_new (); @@ -1090,7 +1091,7 @@ afr_getxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, local->cont.getxattr.name, &xattr); if (ret) - goto out; + goto unlock; xattr = gf_strdup (xattr); @@ -1101,13 +1102,13 @@ afr_getxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, if (ret) { gf_log (this->name, GF_LOG_ERROR, "Cannot set xattr cookie key"); - goto out; + goto unlock; } local->cont.getxattr.xattr_len += strlen (xattr) + 1; } } - out: +unlock: UNLOCK (&frame->lock); if (!callcnt) { @@ -1160,6 +1161,7 @@ afr_getxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, dict_unref (nxattr); } +out: return ret; } |