diff options
author | Jack Wang <jinpu.wang@cloud.ionos.com> | 2021-02-16 17:38:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-04 13:38:09 +0300 |
commit | 248014ab2ea95d7e9b39be603aa69f2945742adf (patch) | |
tree | 9bea4550b34b1ee54c7e04f919afd6f6dd6aab7f /virt | |
parent | d94d6498ba2d3b4e02dcc1b9e3eb25b31bf58c86 (diff) | |
download | linux-248014ab2ea95d7e9b39be603aa69f2945742adf.tar.xz |
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>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions