diff options
Diffstat (limited to 'drivers/oprofile/event_buffer.c')
-rw-r--r-- | drivers/oprofile/event_buffer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c index 00e937e9240e..e7fbac529935 100644 --- a/drivers/oprofile/event_buffer.c +++ b/drivers/oprofile/event_buffer.c | |||
@@ -70,11 +70,12 @@ void wake_up_buffer_waiter(void) | |||
70 | int alloc_event_buffer(void) | 70 | int alloc_event_buffer(void) |
71 | { | 71 | { |
72 | int err = -ENOMEM; | 72 | int err = -ENOMEM; |
73 | unsigned long flags; | ||
73 | 74 | ||
74 | spin_lock(&oprofilefs_lock); | 75 | spin_lock_irqsave(&oprofilefs_lock, flags); |
75 | buffer_size = fs_buffer_size; | 76 | buffer_size = fs_buffer_size; |
76 | buffer_watershed = fs_buffer_watershed; | 77 | buffer_watershed = fs_buffer_watershed; |
77 | spin_unlock(&oprofilefs_lock); | 78 | spin_unlock_irqrestore(&oprofilefs_lock, flags); |
78 | 79 | ||
79 | if (buffer_watershed >= buffer_size) | 80 | if (buffer_watershed >= buffer_size) |
80 | return -EINVAL; | 81 | return -EINVAL; |