linux_dsm_epyc7002/drivers/infiniband
Jack Wang 248014ab2e RDMA/rtrs-srv: Do not pass a valid pointer to PTR_ERR()
[ Upstream commit ed408529679737a9a7ad816c8de5d59ba104bb11 ]

smatch gives the warning:

  drivers/infiniband/ulp/rtrs/rtrs-srv.c:1805 rtrs_rdma_connect() warn: passing zero to 'PTR_ERR'

Which is trying to say smatch has shown that srv is not an error pointer
and thus cannot be passed to PTR_ERR.

The solution is to move the list_add() down after full initilization of
rtrs_srv. To avoid holding the srv_mutex too long, only hold it during the
list operation as suggested by Leon.

Fixes: 03e9b33a0fd6 ("RDMA/rtrs: Only allow addition of path to an already established session")
Link: https://lore.kernel.org/r/20210216143807.65923-1-jinpu.wang@cloud.ionos.com
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-04 11:38:09 +01:00
..
core RDMA/ucma: Fix use-after-free bug in ucma_create_uevent 2021-03-04 11:38:08 +01:00
hw RDMA/hns: Fixes missing error code of CMDQ 2021-03-04 11:38:08 +01:00
sw RDMA/siw: Fix calculation of tx_valid_cpus size 2021-03-04 11:38:05 +01:00
ulp RDMA/rtrs-srv: Do not pass a valid pointer to PTR_ERR() 2021-03-04 11:38:09 +01:00
Kconfig RMDA/sw: Don't allow drivers using dma_virt_ops on highmem configs 2020-11-12 13:27:41 -04:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00