On Tue, Feb 16, 2021 at 03:38:07PM +0100, Jack Wang wrote: > smatch warnings: > drivers/infiniband/ulp/rtrs/rtrs-srv.c:1805 rtrs_rdma_connect() warn: passing zero to 'PTR_ERR' > > Smatch seems confused by the refcount_read condition, the solution is > protect 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: f0751419d3a1 ("RDMA/rtrs: Only allow addition of path to an already established session") > Reported-by: kernel test robot <lkp@xxxxxxxxx> > Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxx> > --- > drivers/infiniband/ulp/rtrs/rtrs-srv.c | 20 +++++++------------- > 1 file changed, 7 insertions(+), 13 deletions(-) Applied to for-next, thanks Jason