]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/core: Fix kernel panic by always initializing qp->usecnt
authorBernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Fri, 20 Jan 2012 18:43:54 +0000 (18:43 +0000)
committerRoland Dreier <roland@purestorage.com>
Fri, 27 Jan 2012 17:20:10 +0000 (09:20 -0800)
commitb0959db31cd8957c6bfcbbcca95ea29ac781d4c7
treedecac0280849f82f81bcaaa9ba465bb512f5cd8b
parent1e5ed5b4d5a9924b9ec96032051e81bc6340728e
RDMA/core: Fix kernel panic by always initializing qp->usecnt

We have just been investigating kernel panics related to
cq->ibcq.event_handler() completion calls.  The problem is that
ib_destroy_qp() fails with -EBUSY.

Further investigation revealed qp->usecnt is not initialized.  This
counter was introduced in linux-3.2 by commit c92e73d77df9
("RDMA/core: Export ib_open_qp() to share XRC TGT QPs") but it only
gets initialized for IB_QPT_XRC_TGT, but it is checked in
ib_destroy_qp() for any QP type.

Fix this by initializing qp->usecnt for every QP we create.

Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Signed-off-by: Sven Breuner <sven.breuner@itwm.fraunhofer.de>
[ Initialize qp->usecnt in uverbs too.  - Sean ]

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/verbs.c