diff options
author | Amar Tumballi <amar@gluster.com> | 2010-07-28 03:31:10 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-28 03:34:54 -0700 |
commit | 927aedbb556ee07250248181f52642eeb6de9e58 (patch) | |
tree | 034a196708a1c1260951cafeefc42b427bee8479 /xlators/protocol/legacy/transport | |
parent | 753146c0ff4b1b55892b71b36d6ca97797867aaa (diff) |
removed last few remaining 'ERR_ABORT's from codebase
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 966 (NULL check for avoiding NULL dereferencing of pointers..)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=966
Diffstat (limited to 'xlators/protocol/legacy/transport')
-rw-r--r-- | xlators/protocol/legacy/transport/ib-verbs/src/ib-verbs.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xlators/protocol/legacy/transport/ib-verbs/src/ib-verbs.c b/xlators/protocol/legacy/transport/ib-verbs/src/ib-verbs.c index 85228bf4e58..0db996405e8 100644 --- a/xlators/protocol/legacy/transport/ib-verbs/src/ib-verbs.c +++ b/xlators/protocol/legacy/transport/ib-verbs/src/ib-verbs.c @@ -731,7 +731,8 @@ ib_verbs_register_peer (ib_verbs_device_t *device, return; } ent = (struct _qpent *) GF_CALLOC (1, sizeof (*ent), gf_ibv_mt_qpent); - ERR_ABORT (ent); + if (!ent) + return; /* TODO: ref reg->peer */ ent->peer = peer; ent->next = &qpreg->ents[hash]; @@ -1522,7 +1523,8 @@ ib_verbs_get_device (transport_t *this, trav = GF_CALLOC (1, sizeof (*trav), gf_ibv_mt_ib_verbs_device_t); - ERR_ABORT (trav); + if (!trav) + return NULL; priv->device = trav; trav->context = ibctx; @@ -2357,10 +2359,16 @@ ib_verbs_server_event_handler (int fd, int idx, void *data, this = GF_CALLOC (1, sizeof (transport_t), gf_ibv_mt_transport_t); - ERR_ABORT (this); + if (!this) + return 0; + priv = GF_CALLOC (1, sizeof (ib_verbs_private_t), gf_ibv_mt_ib_verbs_private_t); - ERR_ABORT (priv); + if (!priv) { + GF_FREE (this); + return 0; + } + this->private = priv; /* Copy all the ib_verbs related values in priv, from trans_priv as other than QP, all the values remain same */ |