diff options
| author | Raghavendra G <raghavendra@gluster.com> | 2009-08-31 22:37:40 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-02 10:30:37 -0700 | 
| commit | 97afc25cc7580df67fd65f41b086e33a45787887 (patch) | |
| tree | 76f9200e247ff599677ffc4d0eaf8fb6c0fb155c /transport/ib-verbs/src/ib-verbs.c | |
| parent | 2e96535c05a114fbefeb3c51cd29217176d61c65 (diff) | |
ib-verbs: handle failure of ibv_create_qp gracefully.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 217 (crash in ib_verbs_create_qp)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=217
Diffstat (limited to 'transport/ib-verbs/src/ib-verbs.c')
| -rw-r--r-- | transport/ib-verbs/src/ib-verbs.c | 3 | 
1 files changed, 3 insertions, 0 deletions
diff --git a/transport/ib-verbs/src/ib-verbs.c b/transport/ib-verbs/src/ib-verbs.c index 0bf432546eb..e39a45eb50e 100644 --- a/transport/ib-verbs/src/ib-verbs.c +++ b/transport/ib-verbs/src/ib-verbs.c @@ -761,6 +761,7 @@ ib_verbs_create_qp (transport_t *this)                          "%s: could not create QP",                          this->xl->name);                  ret = -1; +                goto out;          } else if (ibv_modify_qp (peer->qp, &attr,                                    IBV_QP_STATE              |                                    IBV_QP_PKEY_INDEX         | @@ -771,6 +772,7 @@ ib_verbs_create_qp (transport_t *this)                          "%s: failed to modify QP to INIT state",                          this->xl->name);                  ret = -1; +                goto out;          }          peer->local_lid = ib_verbs_get_local_lid (device->context, @@ -780,6 +782,7 @@ ib_verbs_create_qp (transport_t *this)          ib_verbs_register_peer (device, peer->qp->qp_num, peer); +out:          if (ret == -1)                  __ib_verbs_destroy_qp (this);  | 
