Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Dec 2009 15:40:09 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200947 - head/sys/sparc64/sparc64
Message-ID:  <200912241540.nBOFe9BY034280@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Thu Dec 24 15:40:08 2009
New Revision: 200947
URL: http://svn.freebsd.org/changeset/base/200947

Log:
  Add missing locking in intr_bind().

Modified:
  head/sys/sparc64/sparc64/intr_machdep.c

Modified: head/sys/sparc64/sparc64/intr_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/intr_machdep.c	Thu Dec 24 15:23:51 2009	(r200946)
+++ head/sys/sparc64/sparc64/intr_machdep.c	Thu Dec 24 15:40:08 2009	(r200947)
@@ -450,13 +450,19 @@ int
 intr_bind(int vec, u_char cpu)
 {
 	struct intr_vector *iv;
+	int error;
 
 	if (vec < 0 || vec >= IV_MAX)
 		return (EINVAL);
+	sx_xlock(&intr_table_lock);
 	iv = &intr_vectors[vec];
-	if (iv == NULL)
+	if (iv == NULL) {
+		sx_xunlock(&intr_table_lock);
 		return (EINVAL);
-	return (intr_event_bind(iv->iv_event, cpu));
+	}
+	error = intr_event_bind(iv->iv_event, cpu);
+	sx_xunlock(&intr_table_lock);
+	return (error);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912241540.nBOFe9BY034280>