Commit c646790a authored by Gioh Kim's avatar Gioh Kim Committed by Jens Axboe

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: 2958a995 ("block/rnbd-clt: Support polling mode for IO latency optimization")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: default avatarJack Wang <jinpu.wang@ionos.com>
Link: https://lore.kernel.org/r/20210429092741.266533-1-gi-oh.kim@ionos.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent be4f361d
...@@ -2896,7 +2896,8 @@ EXPORT_SYMBOL(rtrs_clt_request); ...@@ -2896,7 +2896,8 @@ EXPORT_SYMBOL(rtrs_clt_request);
int rtrs_clt_rdma_cq_direct(struct rtrs_clt *clt, unsigned int index) 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_con *con;
struct rtrs_clt_sess *sess; struct rtrs_clt_sess *sess;
struct path_it it; struct path_it it;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment