diff options
author | nik-redhat <nladha@redhat.com> | 2020-09-09 12:19:45 +0530 |
---|---|---|
committer | MOHIT AGRAWAL <moagrawa@redhat.com> | 2020-09-11 07:52:47 +0000 |
commit | 4bd4d1ce6e5a062fb48147de65f7f669101e5f4d (patch) | |
tree | 219e579f1cb46a8c7f5250b57328aa97e4cf96df /xlators/mgmt | |
parent | e96bb6d806c72485be8d6938053547bc5e753b44 (diff) | |
download | glusterfs-4bd4d1ce6e5a062fb48147de65f7f669101e5f4d.tar.gz glusterfs-4bd4d1ce6e5a062fb48147de65f7f669101e5f4d.tar.xz glusterfs-4bd4d1ce6e5a062fb48147de65f7f669101e5f4d.zip |
glusterd: fixing coverity issues
In the last patch merge for the performance.readdir
-ahead dependencies, there was few issues with return
check and NULL derefencing. So, fixed that as per
the coverity scanner.
CID: 1432493
CID: 1432492
Updates: #1060
Change-Id: I6dee6d35ef41ab8d6322f1b2e3734c4796ee2804
Signed-off-by: nik-redhat <nladha@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 00d9338d2e..4e5712e644 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -3359,16 +3359,22 @@ volgen_link_bricks(volgen_graph_t *graph, glusterd_volinfo_t *volinfo, if ((i % sub_count) == 0) { xl = volgen_graph_add_nolink(graph, xl_type, xl_namefmt, volname, j); - if (strncmp(xl_type, "performance/readdir-ahead", - SLEN("performance/readdir-ahead")) == 0) - xlator_set_fixed_option(xl, "performance.readdir-ahead", "on"); j++; } + if (!xl) { ret = -1; goto out; } + if (strncmp(xl_type, "performance/readdir-ahead", + SLEN("performance/readdir-ahead")) == 0) { + ret = xlator_set_fixed_option(xl, "performance.readdir-ahead", + "on"); + if (ret) + goto out; + } + ret = volgen_xlator_link(xl, trav); if (ret) goto out; |