[Feature][ZXW-241]merge P56U01 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I7985538dde6951dd824c36149bf9a1e3ca23c734
diff --git a/ap/os/linux/linux-3.4.x/kernel/relay.c b/ap/os/linux/linux-3.4.x/kernel/relay.c
old mode 100644
new mode 100755
index 56ba44f..e00cbea
--- a/ap/os/linux/linux-3.4.x/kernel/relay.c
+++ b/ap/os/linux/linux-3.4.x/kernel/relay.c
@@ -1050,7 +1050,8 @@
size_t consumed = buf->subbufs_consumed % n_subbufs;
if (!read_pos)
- read_pos = consumed * subbuf_size + buf->bytes_consumed;
+ read_pos = (consumed * subbuf_size + buf->bytes_consumed)
+ % (n_subbufs * subbuf_size);
read_subbuf = read_pos / subbuf_size;
padding = buf->padding[read_subbuf];
padding_start = (read_subbuf + 1) * subbuf_size - padding;