summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2019-05-06 10:35:23 +0530
committerAmar Tumballi <amarts@redhat.com>2019-05-06 13:57:28 +0000
commite0dadeb3242a10827c6142f609c87d860b3ce546 (patch)
tree1cf150a5e507a3ebcb4a2d7074e1ff2f0793fd1e /xlators/mgmt/glusterd/src
parent0d85c6abf5002ff88f17a5292cdde45847154d25 (diff)
glusterd: coverity fix
CID: 1382403 (CHECKED_RETURN) Updates: bz#789278 Change-Id: I4c57b93fd3d14c524ff8519ed876f029834de306 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index b6ebbd76a10..703fb91126c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -2687,7 +2687,13 @@ glusterd_store_retrieve_bricks(glusterd_volinfo_t *volinfo)
}
} else if (!strncmp(key, GLUSTERD_STORE_KEY_BRICK_PORT,
SLEN(GLUSTERD_STORE_KEY_BRICK_PORT))) {
- gf_string2int(value, &brickinfo->port);
+ ret = gf_string2int(value, &brickinfo->port);
+ if (ret == -1) {
+ gf_msg(this->name, GF_LOG_ERROR, EINVAL,
+ GD_MSG_INCOMPATIBLE_VALUE,
+ "Failed to convert "
+ "string to integer");
+ }
if (brickinfo->port < priv->base_port) {
/* This is required to adhere to the
@@ -2702,7 +2708,13 @@ glusterd_store_retrieve_bricks(glusterd_volinfo_t *volinfo)
}
} else if (!strncmp(key, GLUSTERD_STORE_KEY_BRICK_RDMA_PORT,
SLEN(GLUSTERD_STORE_KEY_BRICK_RDMA_PORT))) {
- gf_string2int(value, &brickinfo->rdma_port);
+ ret = gf_string2int(value, &brickinfo->rdma_port);
+ if (ret == -1) {
+ gf_msg(this->name, GF_LOG_ERROR, EINVAL,
+ GD_MSG_INCOMPATIBLE_VALUE,
+ "Failed to convert "
+ "string to integer");
+ }
if (brickinfo->rdma_port < priv->base_port) {
/* This is required to adhere to the