From 2a3090028abc2bf76991c97b117d9a301de10344 Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Wed, 13 Jun 2018 11:44:55 +0530 Subject: 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 --- api/src/glfs-fops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'api/src') 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; } -- cgit