diff options
author | Rinku Kothiya <rkothiya@redhat.com> | 2019-04-23 15:55:22 +0000 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2019-05-07 05:36:08 +0000 |
commit | bbb87ee8a433949eea8b3a2f0bef152ead37ccd7 (patch) | |
tree | 0ea338824fc7c49fdd28c1be0b94ca87774c41b5 /xlators/cluster | |
parent | 291e5ec2a09a145ebb0f4c3ef0b78d616786532f (diff) |
afr : fix Coverity CID 1398627
Fixed coverity error, "Unchecked return value (CHECKED_RETURN)".
Checking return value & logging error message if afr_set_pending_dict
fails.
updates: bz#789278
Change-Id: Iab7da6b4f3cd0622b95b8e1c412b007a330467e5
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/afr/src/afr-transaction.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 8c59fd252aa..2cd8ab20613 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -1188,6 +1188,7 @@ afr_set_changelog_xattr(afr_private_t *priv, unsigned char *pending, { int **changelog = NULL; int idx = 0; + int ret = 0; int i; if (local->is_new_entry == _gf_true) { @@ -1203,7 +1204,11 @@ afr_set_changelog_xattr(afr_private_t *priv, unsigned char *pending, if (local->transaction.failed_subvols[i]) changelog[i][idx] = hton32(1); } - afr_set_pending_dict(priv, xattr, changelog); + ret = afr_set_pending_dict(priv, xattr, changelog); + if (ret < 0) { + afr_matrix_cleanup(changelog, priv->child_count); + return NULL; + } } out: @@ -1259,8 +1264,10 @@ afr_ta_post_op_do(void *opaque) changelog = afr_set_changelog_xattr(priv, pending, xattr, local); - if (!changelog) + if (!changelog) { + ret = -ENOMEM; goto out; + } ret = afr_ta_post_op_lock(this, &loc); if (ret) |