summaryrefslogtreecommitdiffstats
path: root/xlators/encryption
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2018-08-30 17:32:55 +0530
committerAmar Tumballi <amarts@redhat.com>2018-08-31 01:40:00 +0000
commit437455c1608a0c644d14798551c77e9513ba9901 (patch)
treebaa60178d3f2b46fd6754468e225919a8881a2e0 /xlators/encryption
parent4b5e3c347cfb80e4749f1963e25d1dd93563f784 (diff)
crypt : fix coverity issues in crypt.c
This patch fixes CID 1356527, 1356528, 1356529, 1356530, 1395251. Change-Id: Ibdbc56a3221bff3535f02a9e73b57fcbe35c3fbd updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'xlators/encryption')
-rw-r--r--xlators/encryption/crypt/src/crypt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/encryption/crypt/src/crypt.c b/xlators/encryption/crypt/src/crypt.c
index 70087820211..f6e1823ce66 100644
--- a/xlators/encryption/crypt/src/crypt.c
+++ b/xlators/encryption/crypt/src/crypt.c
@@ -1121,8 +1121,10 @@ int crypt_writev(call_frame_t *frame,
vec, count, 0 /* don't setup gup
in tail: we don't
know file size yet */);
- if (ret)
+ if (ret) {
+ ret = ENOMEM;
goto error;
+ }
if (parent_is_crypt_xlator(frame, this)) {
data_t *data;
@@ -2188,6 +2190,7 @@ static int32_t crypt_open(call_frame_t *frame,
ret = loc_copy(local->loc, loc);
if (ret) {
GF_FREE(local->loc);
+ ret = ENOMEM;
goto error;
}
local->fd = fd_ref(fd);
@@ -2574,6 +2577,7 @@ static int32_t crypt_create(call_frame_t *frame,
dict_unref(local->xattr);
free_inode_info(info);
free_format(local);
+ ret = EINVAL;
goto error;
}
ret = dict_set(local->xattr, FSIZE_XATTR_PREFIX, data_from_uint64(0));
@@ -2581,6 +2585,7 @@ static int32_t crypt_create(call_frame_t *frame,
dict_unref(local->xattr);
free_inode_info(info);
free_format(local);
+ ret = ENOMEM;
goto error;
}
local->fd = fd_ref(fd);
@@ -4136,6 +4141,7 @@ static int32_t crypt_readdirp(call_frame_t *frame, xlator_t *this,
ret = dict_set(xdata, FSIZE_XATTR_PREFIX, data_from_uint64(0));
if (ret) {
dict_unref(xdata);
+ ret = ENOMEM;
goto error;
}
STACK_WIND(frame,