diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/oprofile/event_buffer.c | 5 | ||||
-rw-r--r-- | drivers/oprofile/oprofilefs.c | 5 |
2 files changed, 6 insertions, 4 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; |
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index 6e67b42ca46d..8543cb26cf34 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c | |||
@@ -65,6 +65,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t co | |||
65 | int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count) | 65 | int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count) |
66 | { | 66 | { |
67 | char tmpbuf[TMPBUFSIZE]; | 67 | char tmpbuf[TMPBUFSIZE]; |
68 | unsigned long flags; | ||
68 | 69 | ||
69 | if (!count) | 70 | if (!count) |
70 | return 0; | 71 | return 0; |
@@ -77,9 +78,9 @@ int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, siz | |||
77 | if (copy_from_user(tmpbuf, buf, count)) | 78 | if (copy_from_user(tmpbuf, buf, count)) |
78 | return -EFAULT; | 79 | return -EFAULT; |
79 | 80 | ||
80 | spin_lock(&oprofilefs_lock); | 81 | spin_lock_irqsave(&oprofilefs_lock, flags); |
81 | *val = simple_strtoul(tmpbuf, NULL, 0); | 82 | *val = simple_strtoul(tmpbuf, NULL, 0); |
82 | spin_unlock(&oprofilefs_lock); | 83 | spin_unlock_irqrestore(&oprofilefs_lock, flags); |
83 | return 0; | 84 | return 0; |
84 | } | 85 | } |
85 | 86 | ||