From 175f6cc76038920feb27aa76f2401765c1d8cefd Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Mon, 6 Nov 2017 17:54:30 +0530 Subject: features/shard: Coverity fixes This patch fixes coverity issues 242 and 453. Change-Id: If18f40539dccc7c2fcdcf8ef9b6fa3efbb3e462f BUG: 789278 Signed-off-by: Krutika Dhananjay --- xlators/features/shard/src/shard.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xlators') 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; } -- cgit