aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/kernel/perf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index 89d6d5ad44b5..f696f57faa15 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -46,6 +46,7 @@
46#include <linux/init.h> 46#include <linux/init.h>
47#include <linux/proc_fs.h> 47#include <linux/proc_fs.h>
48#include <linux/miscdevice.h> 48#include <linux/miscdevice.h>
49#include <linux/smp_lock.h>
49#include <linux/spinlock.h> 50#include <linux/spinlock.h>
50 51
51#include <asm/uaccess.h> 52#include <asm/uaccess.h>
@@ -260,13 +261,16 @@ printk("Preparing to start counters\n");
260 */ 261 */
261static int perf_open(struct inode *inode, struct file *file) 262static int perf_open(struct inode *inode, struct file *file)
262{ 263{
264 lock_kernel();
263 spin_lock(&perf_lock); 265 spin_lock(&perf_lock);
264 if (perf_enabled) { 266 if (perf_enabled) {
265 spin_unlock(&perf_lock); 267 spin_unlock(&perf_lock);
268 unlock_kernel();
266 return -EBUSY; 269 return -EBUSY;
267 } 270 }
268 perf_enabled = 1; 271 perf_enabled = 1;
269 spin_unlock(&perf_lock); 272 spin_unlock(&perf_lock);
273 unlock_kernel();
270 274
271 return 0; 275 return 0;
272} 276}