linux/drivers/infiniband
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
..
core RDMA/ucma: Fix use-after-free bug in ucma_create_uevent 2021-02-16 14:42:59 -04:00
hw Merge branch 'mlx5_timestamp' into rdma.git for-next 2021-02-16 14:49:36 -04:00
sw RDMA/rxe: Remove unused pkt->offset 2021-02-16 14:42:59 -04:00
ulp RDMA/rtrs-srv: Do not pass a valid pointer to PTR_ERR() 2021-02-16 20:01:56 -04:00
Kconfig RDMA/umem: Support importing dma-buf as user memory region 2021-01-20 16:07:52 -04:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00