]> git.baikalelectronics.ru Git - kernel.git/commit
IB/rdmvat: Fix double vfree() in rvt_create_qp() error path
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Tue, 16 Aug 2016 20:26:29 +0000 (13:26 -0700)
committerDoug Ledford <dledford@redhat.com>
Mon, 22 Aug 2016 19:00:42 +0000 (15:00 -0400)
commitb966412cbcf40dfb5ade5a6ce6f479f24be9516a
treeeb5e5371b2811f9e26392fd05de2fd0efec7ebcf
parenteb5d367fc1bc7ebe4d8347359b74d83ac7c25cdb
IB/rdmvat: Fix double vfree() in rvt_create_qp() error path

The unwind logic for creating a user QP has a double vfree
of the non-shared receive queue when handling a "too many qps"
failure.

The code unwinds the mmmap info by decrementing a reference
count which will call rvt_release_mmap_info() which in turn
does the vfree() of the r_rq.wq.  The unwind code then does
the same free.

Fix by guarding the vfree() with the same test that is done
in close and only do the vfree() if qp->ip is NULL.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rdmavt/qp.c