X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Foprofile%2Fcpu_buffer.c;h=e76d715e4342b70b636183be3e23bbe880a74173;hb=4a4565921aa9255be01921ff8ae339fa7b0a5468;hp=2e03b6d796d39aac794e6c8c52d5de979f82a7c7;hpb=abede81c4fb2e3b85d8760f25e3da39d2c69a134;p=linux-2.6-omap-h63xx.git diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c index 2e03b6d796d..e76d715e434 100644 --- a/drivers/oprofile/cpu_buffer.c +++ b/drivers/oprofile/cpu_buffer.c @@ -393,16 +393,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); }