IB/srp: Avoid that sg_reset -d ${srp_device} triggers an infinite loop
authorBart Van Assche <bvanassche@acm.org>
Tue, 18 Sep 2018 01:10:05 +0000 (18:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 00:01:50 +0000 (17:01 -0700)
commit94b7698c3d23e90c24b89bd7e6b5ab578fc8620c
treec2e29c6b32831c394df5617c6c851b1eb8872e45
parentaa749266a9407e446b231a636eba4e65d155d69b
IB/srp: Avoid that sg_reset -d ${srp_device} triggers an infinite loop

commit ee92efe41cf358f4b99e73509f2bfd4733609f26 upstream.

Use different loop variables for the inner and outer loop. This avoids
that an infinite loop occurs if there are more RDMA channels than
target->req_ring_size.

Fixes: d92c0da71a35 ("IB/srp: Add multichannel support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/ulp/srp/ib_srp.c