All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/rtrs: fix uninitialized symbol 'cnt'
@ 2021-04-29  9:27 Gioh Kim
  2021-04-29 14:28 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Gioh Kim @ 2021-04-29  9:27 UTC (permalink / raw)
  To: linux-block
  Cc: axboe, hch, sagi, bvanassche, haris.iqbal, jinpu.wang, jgg,
	leonro, Gioh Kim, kernel test robot, Dan Carpenter

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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
---
 drivers/infiniband/ulp/rtrs/rtrs-clt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] RDMA/rtrs: fix uninitialized symbol 'cnt'
  2021-04-29  9:27 [PATCH] RDMA/rtrs: fix uninitialized symbol 'cnt' Gioh Kim
@ 2021-04-29 14:28 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-04-29 14:28 UTC (permalink / raw)
  To: Gioh Kim, linux-block
  Cc: hch, sagi, bvanassche, haris.iqbal, jinpu.wang, jgg, leonro,
	kernel test robot, Dan Carpenter

On 4/29/21 3:27 AM, Gioh Kim wrote:
> 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.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-29 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29  9:27 [PATCH] RDMA/rtrs: fix uninitialized symbol 'cnt' Gioh Kim
2021-04-29 14:28 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.