diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c
index d5610ad52b92..bdcd216b73c4 100644
--- a/kernel/locking/osq_lock.c
+++ b/kernel/locking/osq_lock.c
@@ -24,7 +24,7 @@ static inline int encode_cpu(int cpu_nr)
static inline int node_cpu(struct optimistic_spin_node *node)
{
- return node->cpu - 1;
+ return node->prev_cpu - 1;
}
From the first glance, the patch looks OK. The only issue that I have so far is the "node_cpu" name which is misleading in this case. You should have renamed it to node_prev_cpu() instead as there is only one caller.