coverity: Fix coverity issues
This patch fixes coverity CID : 1356537 https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389108&defectInstanceId=26791927&mergedDefectId=1356537 CID : 1395666 https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389187&defectInstanceId=26791932&mergedDefectId=1395666 CID : 1351707 https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389027&defectInstanceId=26791973&mergedDefectId=1351707 CID : 1396910 https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389027&defectInstanceId=26791973&mergedDefectId=13596910 Change-Id: I8094981a741f4d61b083c05a98df23dcf5b022a2 updates: bz#789278 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
This commit is contained in:
parent
6821cec47e
commit
0967f3dd0d
@ -2562,6 +2562,9 @@ glusterfs_process_volfp(glusterfs_ctx_t *ctx, FILE *fp)
|
||||
int ret = -1;
|
||||
xlator_t *trav = NULL;
|
||||
|
||||
if (!ctx)
|
||||
return -1;
|
||||
|
||||
graph = glusterfs_graph_construct(fp);
|
||||
if (!graph) {
|
||||
gf_msg("", GF_LOG_ERROR, 0, glusterfsd_msg_26,
|
||||
@ -2610,7 +2613,7 @@ out:
|
||||
*/
|
||||
if (graph) {
|
||||
xl = graph->first;
|
||||
if ((ctx && (ctx->active != graph)) &&
|
||||
if ((ctx->active != graph) &&
|
||||
(xl && !strcmp(xl->type, "protocol/server"))) {
|
||||
glusterfs_graph_fini(graph);
|
||||
glusterfs_graph_destroy(graph);
|
||||
@ -2618,7 +2621,7 @@ out:
|
||||
}
|
||||
|
||||
/* there is some error in setting up the first graph itself */
|
||||
if (!ctx || !ctx->active) {
|
||||
if (!ctx->active) {
|
||||
emancipate(ctx, ret);
|
||||
cleanup_and_exit(ret);
|
||||
}
|
||||
|
@ -4355,6 +4355,7 @@ quota_statfs_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
|
||||
UNLOCK(&ctx->lock);
|
||||
|
||||
resume:
|
||||
local->op_errno = op_errno;
|
||||
quota_link_count_decrement(frame);
|
||||
return 0;
|
||||
}
|
||||
|
@ -228,6 +228,7 @@ sc_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
|
||||
dict_t *xdata)
|
||||
{
|
||||
char *link = NULL;
|
||||
int op_ret = -1;
|
||||
struct iatt buf = {
|
||||
0,
|
||||
};
|
||||
@ -243,7 +244,8 @@ sc_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
|
||||
using buf in readlink_cbk should be aware that @buf
|
||||
is 0 filled
|
||||
*/
|
||||
STACK_UNWIND_STRICT(readlink, frame, strlen(link), 0, link, &buf, NULL);
|
||||
op_ret = strlen(link);
|
||||
STACK_UNWIND_STRICT(readlink, frame, op_ret, 0, link, &buf, NULL);
|
||||
FREE(link);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1254,6 +1254,11 @@ posix_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
|
||||
goto out;
|
||||
}
|
||||
op_ret = posix_set_iatt_in_dict(unwind_dict, NULL, &postbuf);
|
||||
if (op_ret == -1) {
|
||||
op_errno = ENOMEM;
|
||||
gf_msg(this->name, GF_LOG_ERROR, ENOMEM, P_MSG_DICT_SET_FAILED,
|
||||
"failed to set fdstat in dict");
|
||||
}
|
||||
}
|
||||
|
||||
op_ret = posix_pstat(this, loc->parent, loc->pargfid, par_path, &postparent,
|
||||
|
Loading…
x
Reference in New Issue
Block a user