]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i40iw: Fix double free of allocated_buffer
authorMustafa Ismail <mustafa.ismail@intel.com>
Tue, 23 Aug 2016 21:50:13 +0000 (16:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:21:19 +0000 (15:21 +0200)
commit d41d0910d97f05be987d2d60de7e8685c108963b upstream.

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 <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/i40iw/i40iw_verbs.c

index 283b64c942eebfea6378ee8f4ad5206e6f549876..d2a479cdb1416d9980b344b57c7e8d09774303e2 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);
 }