WSL2-Linux-Kernel/drivers/infiniband/ulp
Jack Wang ed40852967 RDMA/rtrs-srv: Do not pass a valid pointer to PTR_ERR()
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: 03e9b33a0f ("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>
2021-02-16 20:01:56 -04:00
..
ipoib RDMA/ipoib: Remove racy Subnet Manager sendonly join checks 2021-02-16 14:42:58 -04:00
iser IB/iser: Simplify prot_caps setting 2021-01-19 20:02:07 -04:00
isert IB/isert: Simplify signature cap check 2021-01-18 16:59:04 -04:00
opa_vnic RDMA: Convert comma to semicolon 2021-01-07 13:53:41 -04:00
rtrs RDMA/rtrs-srv: Do not pass a valid pointer to PTR_ERR() 2021-02-16 20:01:56 -04:00
srp RDMA/srp: Fix support for unpopulated and unbalanced NUMA nodes 2021-02-16 20:01:50 -04:00
srpt RDMA 5.11 pull request 2020-12-16 13:42:26 -08:00
Makefile RDMA/rtrs: include client and server modules into kernel compilation 2020-05-17 18:57:15 -03:00