Skip to content

Commit c646790

Browse files
Gioh Kimaxboe
authored andcommitted
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: 2958a99 ("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]>
1 parent be4f361 commit c646790

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/infiniband/ulp/rtrs/rtrs-clt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2896,7 +2896,8 @@ EXPORT_SYMBOL(rtrs_clt_request);
28962896

28972897
int rtrs_clt_rdma_cq_direct(struct rtrs_clt *clt, unsigned int index)
28982898
{
2899-
int cnt;
2899+
/* If no path, return -1 for block layer not to try again */
2900+
int cnt = -1;
29002901
struct rtrs_con *con;
29012902
struct rtrs_clt_sess *sess;
29022903
struct path_it it;

0 commit comments

Comments
 (0)