Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965052AbbLSRXV (ORCPT ); Sat, 19 Dec 2015 12:23:21 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34514 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932875AbbLSRXT (ORCPT ); Sat, 19 Dec 2015 12:23:19 -0500 Date: Sat, 19 Dec 2015 18:23:14 +0100 From: Rabin Vincent To: Mathieu Poirier Cc: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V7 17/24] coresight: etb10: implementing AUX space API Message-ID: <20151219172314.GB2437@debian> References: <1450472361-426-1-git-send-email-mathieu.poirier@linaro.org> <1450472361-426-18-git-send-email-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450472361-426-18-git-send-email-mathieu.poirier@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 986 Lines: 30 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) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/