From 9307b943947daa1fe93afdeef5bfae606423b38a Mon Sep 17 00:00:00 2001 From: arao Date: Wed, 11 Feb 2015 16:59:10 +0530 Subject: glusterd: Dereference after null check CID: 1124588 CID: 1124589 CID: 1124590 CID: 1124591 Either the null pointer is dereferenced before the null check or the check for null is unnecessary Change-Id: I87c6b09a4b89c33afd402866e6e249fefb1330f0 BUG: 789278 Signed-off-by: arao Reviewed-on: http://review.gluster.org/9636 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index 098e489d7ae..90bbd0cc40d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -1641,8 +1641,8 @@ glusterd_cluster_lock (call_frame_t *frame, xlator_t *this, this, glusterd_cluster_lock_cbk, (xdrproc_t)xdr_gd1_mgmt_cluster_lock_req); out: - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); - return ret; + gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret); + return ret; } int32_t @@ -1822,7 +1822,9 @@ glusterd_cluster_unlock (call_frame_t *frame, xlator_t *this, this, glusterd_cluster_unlock_cbk, (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_req); out: - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); + gf_log (this ? this->name : "glusterd", + GF_LOG_DEBUG, "Returning %d", ret); + return ret; } @@ -1880,7 +1882,9 @@ out: if ((_gf_true == is_alloc) && req.buf.buf_val) GF_FREE (req.buf.buf_val); - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); + gf_log (this ? this->name : "glusterd", + GF_LOG_DEBUG, "Returning %d", ret); + return ret; } @@ -2193,7 +2197,10 @@ out: txn_id, data); opinfo.op_ret = ret; } - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); + + gf_log (this ? this->name : "glusterd", + GF_LOG_DEBUG, "Returning %d", ret); + return ret; } -- cgit