]> git.karo-electronics.de Git - linux-beck.git/commitdiff
intel_th: msu: Fix offset for wrapped block
authorLaurent FERT <laurent.fert@intel.com>
Mon, 15 Feb 2016 17:11:56 +0000 (19:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 22:09:14 +0000 (14:09 -0800)
Fix offset for the second pass on the wrapped block when iterating over
memory in multi-block mode, otherwise wrong part of the block will get
copied.

Signed-off-by: Laurent FERT <laurent.fert@intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/intel_th/msu.c

index 70ca27e4560214f2f58dc93cf2fad57fbe2e8990..3c793bbf6ab206ea8b48a1a2d0780f78e3d7d31a 100644 (file)
@@ -408,7 +408,7 @@ msc_buffer_iterate(struct msc_iter *iter, size_t size, void *data,
                 * Second time (wrap_count==1), it's just like any other block,
                 * containing data in the range of [MSC_BDESC..data_bytes].
                 */
-               if (iter->block == iter->start_block && iter->wrap_count) {
+               if (iter->block == iter->start_block && iter->wrap_count == 2) {
                        tocopy = DATA_IN_PAGE - data_bytes;
                        src += data_bytes;
                }