All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix SAL info mutex handling
@ 2009-05-05 12:53 Jan Beulich
  2009-05-05 13:17 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2009-05-05 12:53 UTC (permalink / raw)
  To: linux-ia64

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

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 arch/ia64/kernel/salinfo.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.30-rc4/arch/ia64/kernel/salinfo.c	2009-04-30 09:42:36.000000000 +0200
+++ 2.6.30-rc4-ia64-salinfo-lock/arch/ia64/kernel/salinfo.c	2009-05-04 11:31:45.000000000 +0200
@@ -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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix SAL info mutex handling
  2009-05-05 12:53 [PATCH] fix SAL info mutex handling Jan Beulich
@ 2009-05-05 13:17 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2009-05-05 13:17 UTC (permalink / raw)
  To: linux-ia64

On Tue, May 05, 2009 at 01:53:13PM +0100, Jan Beulich wrote:
> 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.

-- 
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."

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-05 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05 12:53 [PATCH] fix SAL info mutex handling Jan Beulich
2009-05-05 13:17 ` Matthew Wilcox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.