From 927aedbb556ee07250248181f52642eeb6de9e58 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 28 Jul 2010 03:31:10 +0000 Subject: removed last few remaining 'ERR_ABORT's from codebase Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 966 (NULL check for avoiding NULL dereferencing of pointers..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=966 --- .../protocol/legacy/transport/ib-verbs/src/ib-verbs.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'xlators/protocol/legacy/transport/ib-verbs/src/ib-verbs.c') 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 85228bf4e..0db996405 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 */ -- cgit