]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Nov 2014 18:10:22 +0000 (10:10 -0800)
commit 5e63dfccf34d4dbf21429c4919f33c028ff49991 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/soc-pcm.c

index 642c862407520db3e36b4ddadf1b5d7a6b467749..002311afdeaa8bd6ceb40d120b0c6afaa13c6119 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;
                        }