linux_dsm_epyc7002/drivers/infiniband/ulp
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
..
ipoib RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
iser RDMA: Add rdma_connect_locked() 2020-10-28 09:14:49 -03:00
isert IB/isert: add module param to set sg_tablesize for IO cmd 2021-02-23 15:53:23 +01:00
opa_vnic treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
rtrs RDMA/rtrs-srv: Do not pass a valid pointer to PTR_ERR() 2021-03-04 11:38:09 +01:00
srp treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
srpt RDMA 5.10 second rc pull request 2020-11-05 11:25:02 -08:00
Makefile RDMA/rtrs: include client and server modules into kernel compilation 2020-05-17 18:57:15 -03:00