summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2018-06-13 11:44:55 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-06-14 14:50:16 +0000
commit2a3090028abc2bf76991c97b117d9a301de10344 (patch)
treec80f4a35a789044cf0b648847d1bfd2707d1272a
parent6ef91480f9e75f63100585bfd19694deb0c2457b (diff)
gfapi : Coverity Fixes
*** CID 1391419: Control flow issues (DEADCODE) glusterfs/api/src/glfs-fops.c: 5224 in glfs_recall_lease_upcall() *** CID 1391414: Memory - illegal accesses (UNINIT) glusterfs/glusterfs/api/src/glfs-fops.c: 5137 in glfs_recall_lease_fd() Fixes: #789278 Change-Id: Ie16103e7e321724d3cf1bdcb815c2e2467b9a366 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
-rw-r--r--api/src/glfs-fops.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 8642da16406..476120b58f0 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -5123,7 +5123,7 @@ glfs_recall_lease_fd (struct glfs *fs,
{
list_for_each_entry (fd, &inode->fd_list, inode_list) {
ret = fd_ctx_get (fd, subvol, &value);
- glfd = (void *) value;
+ glfd = (struct glfs_fd *) value;
if (glfd) {
gf_msg_trace (THIS->name, 0,
"glfd (%p) has held lease", glfd);
@@ -5162,7 +5162,7 @@ glfs_recall_lease_upcall (struct glfs *fs,
struct gf_upcall_recall_lease *recall_lease = NULL;
struct glfs_object *object = NULL;
xlator_t *subvol = NULL;
- int ret = 0;
+ int ret = -1;
struct glfs_upcall_lease *up_lease_arg = NULL;
GF_VALIDATE_OR_GOTO ("gfapi", up_data, out);
@@ -5173,7 +5173,6 @@ glfs_recall_lease_upcall (struct glfs *fs,
subvol = glfs_active_subvol (fs);
if (!subvol) {
- ret = -1;
errno = EIO;
goto out;
}