]> git.baikalelectronics.ru Git - kernel.git/commit
RDMa/hns: Don't stuck in endless timeout loop
authorLeon Romanovsky <leonro@mellanox.com>
Sun, 16 Jun 2019 12:05:58 +0000 (15:05 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Jun 2019 19:39:43 +0000 (15:39 -0400)
commitf05347422cfa1b3b4d2f58797333ce808da59c88
treed530f5d7251dfd6776ad6755fdabff0567e4fc27
parent549d5bc23fff61dcbdcdf26374e4b3b0085afc78
RDMa/hns: Don't stuck in endless timeout loop

The "end" variable is declared as unsigned and can't be negative, it
leads to the situation where timeout limit is not honored, so let's
convert logic to ensure that loop is bounded.

drivers/infiniband/hw/hns/hns_roce_hw_v1.c: In function _hns_roce_v1_clear_hem_:
drivers/infiniband/hw/hns/hns_roce_hw_v1.c:2471:12: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
 2471 |    if (end < 0) {
      |            ^

Fixes: 78208a662ba3 ("RDMA/hns: Remove jiffies operation in disable interrupt context")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hns/hns_roce_hem.h
drivers/infiniband/hw/hns/hns_roce_hw_v1.c