IB/core: Destroy QP if XRC QP fails
authorYuval Avnery <yuvalav@mellanox.com>
Tue, 22 Jan 2019 07:02:05 +0000 (09:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:20:52 +0000 (07:20 +0200)
commite29f63815be8b097c5f2c4156aef1a9849fa4060
tree2cf4c3862349b1d076de9d706438d51a906b3b8f
parente800edf7c578de03b3111c479dc256d2cde807ce
IB/core: Destroy QP if XRC QP fails

commit 535005ca8e5e71918d64074032f4b9d4fef8981e upstream.

The open-coded variant missed destroy of SELinux created QP, reuse already
existing ib_detroy_qp() call and use this opportunity to clean
ib_create_qp() from double prints and unclear exit paths.

Reported-by: Parav Pandit <parav@mellanox.com>
Fixes: d291f1a65232 ("IB/core: Enforce PKey security on QPs")
Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/verbs.c