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>
This commit is contained in:
Jiffin Tony Thottan 2018-06-13 11:44:55 +05:30 committed by Shyamsundar Ranganathan
parent 6ef91480f9
commit 2a3090028a

View File

@ -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;
}