diff options
| author | Takashi Iwai <tiwai@suse.de> | 2009-05-04 16:00:16 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2009-05-04 16:00:16 +0200 |
| commit | 3a20ac2c52b1317f5a5f0bd9cd3cbe8495ddd026 (patch) | |
| tree | 9a912f2609cefb9698b5cce09cd240bd6dbd09fb /drivers/oprofile/cpu_buffer.c | |
| parent | 18cc8d8d9b74c446832336d8f6e1afb145f9431b (diff) | |
| parent | 3e5b50165fd0be080044586f43fcdd460ed27610 (diff) | |
Merge branch 'fix/pcm-jiffies-check' into fix/asoc
Diffstat (limited to 'drivers/oprofile/cpu_buffer.c')
| -rw-r--r-- | drivers/oprofile/cpu_buffer.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c index 2e03b6d796d..f0e99d4c066 100644 --- a/drivers/oprofile/cpu_buffer.c +++ b/drivers/oprofile/cpu_buffer.c @@ -161,7 +161,7 @@ struct op_sample { entry->event = ring_buffer_lock_reserve (op_ring_buffer_write, sizeof(struct op_sample) + - size * sizeof(entry->sample->data[0]), &entry->irq_flags); + size * sizeof(entry->sample->data[0])); if (entry->event) entry->sample = ring_buffer_event_data(entry->event); else @@ -178,8 +178,7 @@ struct op_sample int op_cpu_buffer_write_commit(struct op_entry *entry) { - return ring_buffer_unlock_commit(op_ring_buffer_write, entry->event, - entry->irq_flags); + return ring_buffer_unlock_commit(op_ring_buffer_write, entry->event); } struct op_sample *op_cpu_buffer_read_entry(struct op_entry *entry, int cpu) @@ -393,16 +392,21 @@ oprofile_write_reserve(struct op_entry *entry, struct pt_regs * const regs, return; fail: + entry->event = NULL; cpu_buf->sample_lost_overflow++; } int oprofile_add_data(struct op_entry *entry, unsigned long val) { + if (!entry->event) + return 0; return op_cpu_buffer_add_data(entry, val); } int oprofile_write_commit(struct op_entry *entry) { + if (!entry->event) + return -EINVAL; return op_cpu_buffer_write_commit(entry); } |
