Skip to content

Commit

Permalink
mm/zsmalloc: add missing annotation for pin_tag()
Browse files Browse the repository at this point in the history
Sparse reports a warning at pin_tag()()

warning: context imbalance in pin_tag() - wrong count at exit

The root cause is the missing annotation at pin_tag()
Add the missing __acquires(bitlock) annotation

Signed-off-by: Jules Irenge <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
irenge authored and torvalds committed Apr 7, 2020
1 parent 8a374cc commit 70c7ec9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/zsmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ static inline int trypin_tag(unsigned long handle)
return bit_spin_trylock(HANDLE_PIN_BIT, (unsigned long *)handle);
}

static void pin_tag(unsigned long handle)
static void pin_tag(unsigned long handle) __acquires(bitlock)
{
bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle);
}
Expand Down

0 comments on commit 70c7ec9

Please sign in to comment.