From 456e89aba8c28bff6d8789b0a8f5cf7a236e3a63 Mon Sep 17 00:00:00 2001 From: bwzhou <bwzhou> Date: Tue, 11 Mar 2008 05:09:46 +0000 Subject: [PATCH] Branch b1_6 b=13285 r=johann, nathan cid-290: fixes some oti_init to return earlier if NULL value --- lustre/include/obd.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index c999e0fe62..297d8dbfe6 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -657,17 +657,18 @@ static inline void oti_init(struct obd_trans_info *oti, { if (oti == NULL) return; - memset(oti, 0, sizeof *oti); + memset(oti, 0, sizeof(*oti)); if (req == NULL) return; oti->oti_xid = req->rq_xid; - if ((req->rq_reqmsg != NULL) && (req->rq_repmsg != NULL)) + if (req->rq_repmsg != NULL) oti->oti_transno = lustre_msg_get_transno(req->rq_repmsg); oti->oti_thread_id = req->rq_svc_thread ? req->rq_svc_thread->t_id : -1; - oti->oti_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg); + if (req->rq_reqmsg != NULL) + oti->oti_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg); } static inline void oti_alloc_cookies(struct obd_trans_info *oti,int num_cookies) -- GitLab