lkml.org 
[lkml]   [2017]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 046/294] RDMA/ocrdma: Fix an error code in ocrdma_alloc_pd()
    3.16.50-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Dan Carpenter <dan.carpenter@oracle.com>

    commit dd75cfa6d3216c79c695f5af13e52208afe374ad upstream.

    We should preserve the original "status" error code instead of resetting
    it to zero. Returning ERR_PTR(0) is the same as NULL and results in a
    NULL dereference in the callers. I added a printk() on error instead.

    Fixes: 45e86b33ec8b ("RDMA/ocrdma: Cache recv DB until QP moved to RTR")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Doug Ledford <dledford@redhat.com>
    [bwh: Backported to 3.16: keep calling ocrdma_mbx_dealloc_pd()]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
    +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
    @@ -565,7 +565,8 @@ err:
    if (is_uctx_pd) {
    ocrdma_release_ucontext_pd(uctx);
    } else {
    - status = ocrdma_mbx_dealloc_pd(dev, pd);
    + if (ocrdma_mbx_dealloc_pd(dev, pd))
    + pr_err("%s: ocrdma_mbx_dealloc_pd() failed\n", __func__);
    kfree(pd);
    }
    exit:
    \
     
     \ /
      Last update: 2017-11-08 20:59    [W:4.563 / U:0.292 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site