lkml.org 
[lkml]   [2015]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V7 17/24] coresight: etb10: implementing AUX space API
On Fri, Dec 18, 2015 at 01:59:13PM -0700, Mathieu Poirier wrote:
> +static void etb_update_buffer(struct coresight_device *csdev,
> + struct perf_output_handle *handle,
> + void *sink_config)
> +{
> + int i, cur;
> + u32 *buf_ptr;

...

> + for (i = 0; i < to_read; i += 4) {
> + buf_ptr = buf->data_pages[cur] + offset;
> + read_data = readl_relaxed(drvdata->base +
> + ETB_RAM_READ_DATA_REG);
> + *buf_ptr++ = read_data >> 0;
> + *buf_ptr++ = read_data >> 8;
> + *buf_ptr++ = read_data >> 16;
> + *buf_ptr++ = read_data >> 24;

buf_ptr should either be changed to a u8* or just the first write should
be present. Otherwise this overwrites lots of memory.

> +
> + offset += 4;
> + if (offset >= PAGE_SIZE) {


\
 
 \ /
  Last update: 2015-12-19 18:41    [W:0.561 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site