i40iw: Fix double free of allocated_buffer
authorMustafa Ismail <[email protected]>
Tue, 23 Aug 2016 21:50:13 +0000 (16:50 -0500)
committerDoug Ledford <[email protected]>
Wed, 24 Aug 2016 15:31:39 +0000 (11:31 -0400)
Memory allocated for iwqp; iwqp->allocated_buffer is freed twice in
the create_qp error path. Correct this by having it freed only once in
i40iw_free_qp_resources().

Fixes: d37498417947 ("i40iw: add files for iwarp interface")
Signed-off-by: Mustafa Ismail <[email protected]>
Signed-off-by: Shiraz Saleem <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
drivers/infiniband/hw/i40iw/i40iw_verbs.c

index 2360338877bf68ca4a809d153f83a64326fa467c..722e5af1e3d85392b3345637ee8b0b601900adb5 100644 (file)
@@ -794,7 +794,6 @@ static struct ib_qp *i40iw_create_qp(struct ib_pd *ibpd,
        return &iwqp->ibqp;
 error:
        i40iw_free_qp_resources(iwdev, iwqp, qp_num);
-       kfree(mem);
        return ERR_PTR(err_code);
 }