aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGioh Kim <[email protected]>2021-04-29 11:27:41 +0200
committerJens Axboe <[email protected]>2021-05-03 11:00:11 -0600
commitc646790a1fcae7738972accc41ccaa4983e5c234 (patch)
tree81134ca1e9af73e113cac91876e12a8cf06e9eb1
parentbe4f361d69f4487ab56eb67b0cd0559fb1895af2 (diff)
RDMA/rtrs: fix uninitialized symbol 'cnt'
rtrs_clt_rdma_cq_direct returns an ninitialized value in cnt if there is no session. This patch makes rtrs_clt_rdma_cq_direct returns a negative value for block layer not to try again. Fixes: 2958a995edc94 ("block/rnbd-clt: Support polling mode for IO latency optimization") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Gioh Kim <[email protected]> Signed-off-by: Jack Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--drivers/infiniband/ulp/rtrs/rtrs-clt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index b74a872387c4..934a2ff18e7f 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -2896,7 +2896,8 @@ EXPORT_SYMBOL(rtrs_clt_request);
int rtrs_clt_rdma_cq_direct(struct rtrs_clt *clt, unsigned int index)
{
- int cnt;
+ /* If no path, return -1 for block layer not to try again */
+ int cnt = -1;
struct rtrs_con *con;
struct rtrs_clt_sess *sess;
struct path_it it;