Skip to contentSkip to conversation

fix SAL info mutex handling

PATCH In review Jan Beulich 2 participants 2 messages May 5, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix SAL info mutex handling

Using up() on a mutex that wasn't necessarily acquired seems wrong.

---
 arch/ia64/kernel/salinfo.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/ia64/kernel/salinfo.c +2 -2
@@ -192,8 +192,8 @@ struct salinfo_platform_oemdata_parms {
 static void
 salinfo_work_to_do(struct salinfo_data *data)
 {
-	down_trylock(&data->mutex);
-	up(&data->mutex);
+	if (down_trylock(&data->mutex) = 0)
+		up(&data->mutex);
 }
 
 static void
#1 lore raw
Quoted 1 line · Jan Beulich

Using up() on a mutex that wasn't necessarily acquired seems wrong.

Yeah, but search the archives, there's a reason for this horrible abuse.

Signature · 4 lines
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."