RDMA/ucma: Fix resource leak on error path
authorAlex Dewar <alex.dewar90@gmail.com>
Wed, 2 Sep 2020 16:24:51 +0000 (17:24 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 2 Sep 2020 20:06:48 +0000 (17:06 -0300)
commit4f680cb9f1bb6c2b5cd3574533702334709e50ad
tree9856a2b8ed8a5d444fb51206c7e21c8485ee93d9
parent7d11b4787d538295f65dcd002954a0f8ed2c393c
RDMA/ucma: Fix resource leak on error path

In ucma_process_join(), if the call to xa_alloc() fails, the function will
return without freeing mc. Fix this by jumping to the correct line.

In the process I renamed the jump labels to something more memorable for
extra clarity.

Link: https://lore.kernel.org/r/20200902162454.332828-1-alex.dewar90@gmail.com
Addresses-Coverity-ID: 1496814 ("Resource leak")
Fixes: 95fe51096b7a ("RDMA/ucma: Remove mc_list and rely on xarray")
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/ucma.c