]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: u_audio: remove cached period bytes value
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Thu, 21 Jun 2018 15:22:50 +0000 (17:22 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 17 Jul 2018 07:12:51 +0000 (10:12 +0300)
commit1d8aad4f396ad8f35ee77e9114acc0cb64e32b06
treef4658f651c458b9ffe03ebcbf2604f790d5d8b41
parent62a4969c7d5efa3d6864595aa409c7d7df9dd89a
usb: gadget: u_audio: remove cached period bytes value

Substream period size potentially can be changed in runtime, however
this is not accounted in the data copying routine, the change replaces
the cached value with an actual value from substream runtime.

As a side effect the change also removes a potential division by zero
in u_audio_iso_complete() function, if there is a race with
uac_pcm_hw_free(), which sets prm->period_size to 0.

Fixes: 6049421176fb ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/u_audio.c