summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2010-01-15 15:36:12 +0000
committermarius <marius@FreeBSD.org>2010-01-15 15:36:12 +0000
commit729d47e449667e8358c956217ac41d7c5470aed3 (patch)
treea1ee2c42bb346a1d28d7e0e2bacb14bf3f696a25 /sys/sparc64
parent7b94d4fa69a5dcf24490d61b6ce4cb422367197d (diff)
downloadFreeBSD-src-729d47e449667e8358c956217ac41d7c5470aed3.zip
FreeBSD-src-729d47e449667e8358c956217ac41d7c5470aed3.tar.gz
MFC: r200947
Add missing locking in intr_bind().
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/intr_machdep.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/sparc64/sparc64/intr_machdep.c b/sys/sparc64/sparc64/intr_machdep.c
index d0174b9..f47ad0e 100644
--- a/sys/sparc64/sparc64/intr_machdep.c
+++ b/sys/sparc64/sparc64/intr_machdep.c
@@ -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);
}
/*
OpenPOWER on IntegriCloud