summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2018-09-21 16:03:22 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-09-25 15:26:19 +0000
commitf1b2455b9d01bae8c4652fc3583a60ff7000410e (patch)
tree30abf3e835b15f2f315a313a012c5f47008b9a4e /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent31dcbb61487ac82b5ae61435add98b0fd1d5e8cc (diff)
glusterd: fix coverity issues
This patch addreeses CID 1124812, 11248123, 1124833, and 1351706 1. We have a null check after GF_ASSERT. GF_ASSERT does a null check and fails if it is null. So removing the redundant null checks. 2. Added a log message to avoid unused value coverity issue Change-Id: Ib0d6dad8f40474afc8e5e60a531d37247cc8a081 updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 9c00f6b..3c32cf9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -4725,7 +4725,7 @@ nfs_option_handler(volgen_graph_t *graph, struct volopt_map_entry *vme,
if (!volinfo || (volinfo->volname[0] == '\0'))
return 0;
- if (!vme || (vme->option[0] == '\0'))
+ if (!vme || !(vme->option))
return 0;
if (!strcmp(vme->option, "!rpc-auth.addr.*.allow")) {
@@ -4851,8 +4851,7 @@ nfs_option_handler(volgen_graph_t *graph, struct volopt_map_entry *vme,
return -1;
}
- if ((strcmp(vme->voltype, "nfs/server") == 0) &&
- (vme->option && vme->option[0] != '!')) {
+ if ((strcmp(vme->voltype, "nfs/server") == 0) && (vme->option[0] != '!')) {
ret = xlator_set_option(xl, vme->option, vme->value);
if (ret)
return -1;