ASoC: soc-pcm: fix sig_bits determination in soc_pcm_apply_msb()
authorDaniel Mack <daniel@zonque.org>
Tue, 7 Oct 2014 12:33:46 +0000 (14:33 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 7 Oct 2014 18:14:20 +0000 (19:14 +0100)
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.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
sound/soc/soc-pcm.c

index 731fdb5..14a3df1 100644 (file)
@@ -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;
                        }