RDMA/cxgb4: Initialization errors can cause crash.
Subsystems (2)
PATCH 1/1 RDMA/cxgb4: Initialization errors can cause crash.
c4iw_uld_add() must return ERR_PTR() values instead of NULL on failure.
Signed-off-by Steve Wise <[email protected]>
---
drivers/infiniband/hw/cxgb4/device.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/cxgb4/device.c +3 -3
@@ -392,7 +392,7 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) devp = (struct c4iw_dev *)ib_alloc_device (sizeof (*devp));if (!devp) { printk(KERN_ERR MOD "Cannot allocate ib device\n"); -return NULL ; +return ERR_PTR (-ENOMEM ); } devp->rdev.lldi = *infop;
@@ -414,7 +414,7 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)mutex_unlock (&dev_mutex); printk(KERN_ERR MOD "Unable to open CXIO rdev err %d\n", ret);ib_dealloc_device (&devp->ibdev); -return NULL ; +return ERR_PTR (ret); }idr_init (&devp->cqidr);
@@ -444,7 +444,7 @@ static void *c4iw_uld_add(const struct cxgb4_lld_info *infop) DRV_VERSION); dev =c4iw_alloc (infop); -if (!dev) +if (IS_ERR (dev)) goto out; PDBG("%s found device %s nchan %u nrxq %u ntxq %u nports %u\n",
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20110331193642.6723.23391.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org
Quoted 1 line · Steve Wise
c4iw_uld_add()must returnERR_PTR()values instead of NULL on failure.
Thanks, applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html