Skip to contentSkip to conversation

ASoC: soc-pcm: fix sig_bits determination in soc_pcm_apply_msb()

PATCH Applied Daniel Mack 2 participants 2 messages Oct 7, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: soc-pcm: fix sig_bits determination in soc_pcm_apply_msb()

In the SNDRV_PCM_STREAM_CAPTURE branch in soc_pcm_apply_msb(), look at sig_bits of the capture stream, not the playback one.

Spotted by coverity.

---
 sound/soc/soc-pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-pcm.c +1 -1
index 642c862..002311a 100644
@@ -352,7 +352,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream)
 	} else {
 		for (i = 0; i < rtd->num_codecs; i++) {
 			codec_dai = rtd->codec_dais[i];
-			if (codec_dai->driver->playback.sig_bits == 0) {
+			if (codec_dai->driver->capture.sig_bits == 0) {
 				bits = 0;
 				break;
 			}
Signature · 1 line
2.1.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Daniel Mack

In the SNDRV_PCM_STREAM_CAPTURE branch in soc_pcm_apply_msb(), look at sig_bits of the capture stream, not the playback one.

Applied, thanks.