summaryrefslogtreecommitdiffstats
path: root/xlators/features/shard/src/shard.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2017-11-06 17:54:30 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-11-08 18:04:27 +0000
commit175f6cc76038920feb27aa76f2401765c1d8cefd (patch)
tree277ceeb9a2754836ac8501e3852b0b4a2a0dc7c0 /xlators/features/shard/src/shard.c
parent32d67a77c5d0b117659ffec2fff75717f9770568 (diff)
features/shard: Coverity fixes
This patch fixes coverity issues 242 and 453. Change-Id: If18f40539dccc7c2fcdcf8ef9b6fa3efbb3e462f BUG: 789278 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'xlators/features/shard/src/shard.c')
-rw-r--r--xlators/features/shard/src/shard.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 3b6b41b4ab6..decc09fe188 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -4972,7 +4972,7 @@ init (xlator_t *this)
if (!this) {
gf_msg ("shard", GF_LOG_ERROR, 0, SHARD_MSG_NULL_THIS,
"this is NULL. init() failed");
- goto out;
+ return -1;
}
if (!this->parents) {
@@ -5096,18 +5096,21 @@ shard_priv_dump (xlator_t *this)
{
shard_priv_t *priv = NULL;
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0,};
+ char *str = NULL;
priv = this->private;
snprintf (key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type,
this->name);
gf_proc_dump_add_section (key_prefix);
- gf_proc_dump_write ("shard-block-size", "%s",
- gf_uint64_2human_readable (priv->block_size));
+ str = gf_uint64_2human_readable (priv->block_size);
+ gf_proc_dump_write ("shard-block-size", "%s", str);
gf_proc_dump_write ("inode-count", "%d", priv->inode_count);
gf_proc_dump_write ("ilist_head", "%p", &priv->ilist_head);
gf_proc_dump_write ("lru-max-limit", "%d", SHARD_MAX_INODES);
+ GF_FREE (str);
+
return 0;
}