Skip to content

Commit f782456

Browse files
povikmarcan
authored andcommitted
afk: Add missing wptr wraparound
Signed-off-by: Martin Povišer <[email protected]>
1 parent 264e181 commit f782456

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/afk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ static int afk_epic_tx(afk_epic_ep_t *epic, u32 channel, u32 type, void *data, s
302302

303303
wptr += size;
304304
wptr = ALIGN_UP(wptr, 1 << BLOCK_SHIFT);
305+
if (wptr >= rb->bufsz)
306+
wptr = 0;
305307

306308
memcpy(hdr + 1, data, size);
307309

0 commit comments

Comments
 (0)