Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jan 2010 15:36:24 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r202374 - stable/7/sys/sparc64/sparc64
Message-ID:  <201001151536.o0FFaO2v013991@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Fri Jan 15 15:36:24 2010
New Revision: 202374
URL: http://svn.freebsd.org/changeset/base/202374

Log:
  MFC: r200947
  
  Add missing locking in intr_bind().

Modified:
  stable/7/sys/sparc64/sparc64/intr_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c
==============================================================================
--- stable/7/sys/sparc64/sparc64/intr_machdep.c	Fri Jan 15 15:36:12 2010	(r202373)
+++ stable/7/sys/sparc64/sparc64/intr_machdep.c	Fri Jan 15 15:36:24 2010	(r202374)
@@ -451,13 +451,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?201001151536.o0FFaO2v013991>