Skip to content

Commit

Permalink
Merge branch 'perf-urgent-for-linus' of git://tesla.tglx.de/git/linux…
Browse files Browse the repository at this point in the history
…-2.6-tip

* 'perf-urgent-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip:
  perf tools: Fix raw sample reading
  • Loading branch information
Linus Torvalds committed Oct 2, 2011
2 parents f72a209 + 9d3ec7a commit 2e51818
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,
}

if (type & PERF_SAMPLE_RAW) {
const u64 *pdata;

u.val64 = *array;
if (WARN_ONCE(swapped,
"Endianness of raw data not corrected!\n")) {
Expand All @@ -462,11 +464,12 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,
return -EFAULT;

data->raw_size = u.val32[0];
pdata = (void *) array + sizeof(u32);

if (sample_overlap(event, &u.val32[1], data->raw_size))
if (sample_overlap(event, pdata, data->raw_size))
return -EFAULT;

data->raw_data = &u.val32[1];
data->raw_data = (void *) pdata;
}

return 0;
Expand Down

0 comments on commit 2e51818

Please sign in to comment.