Commit 6c7d2a75 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Roland Dreier

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: default avatarMichael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 44b5b030
...@@ -233,7 +233,7 @@ void *mthca_table_find(struct mthca_icm_table *table, int obj) ...@@ -233,7 +233,7 @@ void *mthca_table_find(struct mthca_icm_table *table, int obj)
for (i = 0; i < chunk->npages; ++i) { for (i = 0; i < chunk->npages; ++i) {
if (chunk->mem[i].length >= offset) { if (chunk->mem[i].length >= offset) {
page = chunk->mem[i].page; page = chunk->mem[i].page;
break; goto out;
} }
offset -= chunk->mem[i].length; offset -= chunk->mem[i].length;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment