Skip to content

Commit

Permalink
afk: Add missing wptr wraparound
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Povišer <[email protected]>
  • Loading branch information
povik authored and marcan committed Aug 17, 2023
1 parent 264e181 commit f782456
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/afk.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ static int afk_epic_tx(afk_epic_ep_t *epic, u32 channel, u32 type, void *data, s

wptr += size;
wptr = ALIGN_UP(wptr, 1 << BLOCK_SHIFT);
if (wptr >= rb->bufsz)
wptr = 0;

memcpy(hdr + 1, data, size);

Expand Down

0 comments on commit f782456

Please sign in to comment.