From 3e340c05c0def3bb68db6751299b7821c2ba0621 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 11 Mar 2010 16:17:28 +0000 Subject: IB/cm: Fix device_create() return value check Use IS_ERR() instead of comparing to NULL. Signed-off-by: Jani Nikula Signed-off-by: Roland Dreier --- drivers/infiniband/core/cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 764787ebe8d..c9730cb3f69 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -3693,7 +3693,7 @@ static void cm_add_one(struct ib_device *ib_device) cm_dev->device = device_create(&cm_class, &ib_device->dev, MKDEV(0, 0), NULL, "%s", ib_device->name); - if (!cm_dev->device) { + if (IS_ERR(cm_dev->device)) { kfree(cm_dev); return; } -- cgit v1.2.3 From eadde3a1a5291492098e8b0b6435d075fc22486b Mon Sep 17 00:00:00 2001 From: Chien Tung Date: Thu, 25 Mar 2010 13:39:50 +0000 Subject: RDMA/nes: Correct cap.max_inline_data assignment in nes_query_qp() cap.max_inline_data is incorrectly set in init_attr instead of attr. Set it in attr so subsequent init_attr.cap assignment will get the correct value. Signed-off-by: Chien Tung Signed-off-by: Roland Dreier --- drivers/infiniband/hw/nes/nes_verbs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 69928296d74..36348bf9dee 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -2820,11 +2820,10 @@ static int nes_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, attr->cap.max_send_wr = nesqp->hwqp.sq_size; attr->cap.max_recv_wr = nesqp->hwqp.rq_size; attr->cap.max_recv_sge = 1; - if (nes_drv_opt & NES_DRV_OPT_NO_INLINE_DATA) { - init_attr->cap.max_inline_data = 0; - } else { - init_attr->cap.max_inline_data = 64; - } + if (nes_drv_opt & NES_DRV_OPT_NO_INLINE_DATA) + attr->cap.max_inline_data = 0; + else + attr->cap.max_inline_data = 64; init_attr->event_handler = nesqp->ibqp.event_handler; init_attr->qp_context = nesqp->ibqp.qp_context; -- cgit v1.2.3 From 7bd912998ec9cdbb0268138b6b51f28adf7865f4 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 7 Apr 2010 09:39:01 +0000 Subject: IB/mlx4: Check correct variable for allocation failure The intent here is to check the "mfrpl->mapped_page_list" allocation. We checked "mfrpl->ibfrpl.page_list" earlier. Signed-off-by: Dan Carpenter Signed-off-by: Roland Dreier --- drivers/infiniband/hw/mlx4/mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 8f3666b20ea..63ec26f6b0c 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c @@ -238,7 +238,7 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device mfrpl->mapped_page_list = dma_alloc_coherent(&dev->dev->pdev->dev, size, &mfrpl->map, GFP_KERNEL); - if (!mfrpl->ibfrpl.page_list) + if (!mfrpl->mapped_page_list) goto err_free; WARN_ON(mfrpl->map & 0x3f); -- cgit v1.2.3