x86/mm: Fix operator associativity bug in mm-locks.h

In an order-enforcing wrapper for an "external" recursive lock,
we aim to increment/decrement a recurse count and only update the
lock ordering on zero counts.

Unfortunately we incrementing/decrementing the pointer to the
recurse count, rather than the count itself.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
This commit is contained in:
Tim Deegan committed 2012-01-12 16:39:05 +00:00
1 parent d80c482605
commit e4dbfcfe9d
1 file changed
+2 -2
+2 -2
View File
@@ -81,7 +81,7 @@ static inline void _mm_enforce_order_lock_post(int level, int *unlock_level,
{
if ( recurse_count )
{
if ( *recurse_count++ == 0 )
if ( (*recurse_count)++ == 0 )
{
*unlock_level = __get_lock_level();
}
@@ -125,7 +125,7 @@ static inline void mm_enforce_order_unlock(int unlock_level,
if ( recurse_count )
{
BUG_ON(*recurse_count == 0);
if ( *recurse_count-- == 1 )
if ( (*recurse_count)-- == 1 )
{
__set_lock_level(unlock_level);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.