RDMA/i40iw: Fix error unwinding when i40iw_hmc_sd_one fails
authorSindhu Devale <sindhu.devale@intel.com>
Fri, 16 Apr 2021 00:21:04 +0000 (19:21 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:40:28 +0000 (10:40 +0200)
commit90f6c294b45a4aa6cb1a0b8b70c97d8b36c68860
treedf059ebedb550f98aab6dfe599ed3bc1ee59f2a7
parent5d3daa2895fe71c0e7f237d13a49e6cdfa972a55
RDMA/i40iw: Fix error unwinding when i40iw_hmc_sd_one fails

[ Upstream commit 783a11bf2400e5d5c42a943c3083dc0330751842 ]

When i40iw_hmc_sd_one fails, chunk is freed without the deletion of chunk
entry in the PBLE info list.

Fix it by adding the chunk entry to the PBLE info list only after
successful addition of SD in i40iw_hmc_sd_one.

This fixes a static checker warning reported here:
  https://lore.kernel.org/linux-rdma/YHV4CFXzqTm23AOZ@mwanda/

Fixes: 9715830157be ("i40iw: add pble resource files")
Link: https://lore.kernel.org/r/20210416002104.323-1-shiraz.saleem@intel.com
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sindhu Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/i40iw/i40iw_pble.c