Browse Source

IB/mthca: Fix thinko in mthca_table_find()

break only escapes from the innermost loop, and we want to escape both
loops and return an answer.  Noticed by Ishai Rabinovitch.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Michael S. Tsirkin 19 năm trước cách đây
mục cha
commit
6c7d2a75b5
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      drivers/infiniband/hw/mthca/mthca_memfree.c

+ 1 - 1
drivers/infiniband/hw/mthca/mthca_memfree.c

@@ -233,7 +233,7 @@ void *mthca_table_find(struct mthca_icm_table *table, int obj)
 		for (i = 0; i < chunk->npages; ++i) {
 			if (chunk->mem[i].length >= offset) {
 				page = chunk->mem[i].page;
-				break;
+				goto out;
 			}
 			offset -= chunk->mem[i].length;
 		}