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 047/294] RDMA/ocrdma: Fix error codes in ocrdma_create_srq()
    3.16.50-rc1 review patch.  If anyone has any objections, please let me know.

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

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

    commit f0c6e88288d65c93bbc7da4fb6f7d51b2733228a upstream.

    If either of these allocations fail then we return ERR_PTR(0). That's
    equivalent to NULL and results in a NULL pointer dereference in the
    caller.

    Fixes: fe2caefcdf58 ("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Doug Ledford <dledford@redhat.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
    +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
    @@ -1720,6 +1720,7 @@ struct ib_srq *ocrdma_create_srq(struct
    goto err;

    if (udata == NULL) {
    + status = -ENOMEM;
    srq->rqe_wr_id_tbl = kzalloc(sizeof(u64) * srq->rq.max_cnt,
    GFP_KERNEL);
    if (srq->rqe_wr_id_tbl == NULL)
    \
     
     \ /
      Last update: 2017-11-08 20:58    [W:4.304 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site