Skip to content

Commit

Permalink
IB/mlx4: Fix last allocated object tracking in bitmap allocator
Browse files Browse the repository at this point in the history
Set last allocated object to the object after the one just allocated
before ORing in the extra top bits.  Also handle the case where this
wraps around.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed May 29, 2007
1 parent d998ccc commit a2cb4a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/mlx4/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap)

if (obj < bitmap->max) {
set_bit(obj, bitmap->table);
bitmap->last = (obj + 1) & (bitmap->max - 1);
obj |= bitmap->top;
bitmap->last = obj + 1;
} else
obj = -1;

Expand Down

0 comments on commit a2cb4a9

Please sign in to comment.