xprtrdma: Free the pd if ib_query_qp() fails
authorChuck Lever <chuck.lever@oracle.com>
Wed, 21 Jan 2015 16:03:19 +0000 (11:03 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:14 +0000 (23:16 +0100)
commit420ffb9392fba08a09bd463debce801c46742ee9
tree836d74b730bf4d20532af75f211b9dd56538b5ec
parent268b9d240c0cbcbc25f3a5a54041f001cd91f3d4
xprtrdma: Free the pd if ib_query_qp() fails

commit 5ae711a24601257f395c1f8746ac95be0cbd75e5 upstream.

If ib_query_qp() fails or the memory registration mode isn't
supported, don't leak the PD. An orphaned IB/core resource will
cause IB module removal to hang.

Fixes: bd7ed1d13304 ("RPC/RDMA: check selected memory registration ...")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
[bwh: Backported to 3.2:
 - Adjust context
 - There are only 2 goto's to be changed, not 3]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/sunrpc/xprtrdma/verbs.c