transport/ib-verbs: assign to qpreg before accessing it in __ib_verbs_lookup_peer.

Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 381 (glusterfs crash in ib-verbs)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=381
This commit is contained in:
Raghavendra G 2009-11-18 15:07:22 +00:00 committed by Anand V. Avati
parent 68a9546e5c
commit 717faf468f

View File

@ -698,6 +698,7 @@ __ib_verbs_lookup_peer (ib_verbs_device_t *device, int32_t qp_num)
ib_verbs_qpreg_t *qpreg = NULL;
int32_t hash = 0;
qpreg = &device->qpreg;
hash = qp_num % 42;
ent = qpreg->ents[hash].next;
while ((ent != &qpreg->ents[hash]) && (ent->qp_num != qp_num))