Skip to content

Commit

Permalink
IB/mthca: Fix thinko in mthca_table_find()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Dec 15, 2005
1 parent 44b5b03 commit 6c7d2a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/mthca/mthca_memfree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c7d2a7

Please sign in to comment.