From ec9e43138f1219966850477e056f6eb7fbcc4fa4 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 27 Aug 2014 19:09:06 +0200 Subject: [PATCH] usb: gadget: f_uac2: handle partial dma area wrap With packet sizes other than 512, payloads in the packets may wrap around the ALSA dma buffer partially, which leads to memory corruption and audible clicks and pops in the audio stream at the moment, because there is no boundary check before the memcpy(). In preparation to an implementation for smaller and dynamically sized packets, we have to address such cases, and copy the payload in two steps conditionally. The 'src' and 'dst' approach doesn't work here anymore, as different behavior is necessary in playback and capture cases. Thus, this patch open-codes the routine now. Signed-off-by: Daniel Mack Signed-off-by: Felipe Balbi --- Reading git-format-patch failed