RDMA/qedr: Fix resource leak in qedr_create_qp
authorKeita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Fri, 11 Sep 2020 12:51:59 +0000 (12:51 +0000)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 18 Sep 2020 15:45:41 +0000 (12:45 -0300)
commit3e45410fe3c202ffb619f301beff0644f717e132
tree697110b35ca9488c3b46895d4deb3bb24ed7fd7f
parent8d539c6109f203bb237c7c1eb73d4665869bab1a
RDMA/qedr: Fix resource leak in qedr_create_qp

When xa_insert() fails, the acquired resource in qedr_create_qp should
also be freed. However, current implementation does not handle the error.

Fix this by adding a new goto label that calls qedr_free_qp_resources.

Fixes: 1212767e23bb ("qedr: Add wrapping generic structure for qpidr and adjust idr routines.")
Link: https://lore.kernel.org/r/20200911125159.4577-1-keitasuzuki.park@sslab.ics.keio.ac.jp
Signed-off-by: Keita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Acked-by: Michal KalderonĀ <michal.kalderon@marvell.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/qedr/verbs.c