ASoC: dwc: Don't allow negative use counts
authorAndrew Jackson <Andrew.Jackson@arm.com>
Fri, 29 Aug 2014 14:02:38 +0000 (15:02 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Tue, 7 Oct 2014 11:10:59 +0000 (12:10 +0100)
Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com>
sound/soc/dwc/designware_i2s.c

index d202c7c..bd2fcd7 100644 (file)
@@ -280,7 +280,8 @@ static int dw_i2s_trigger(struct snd_pcm_substream *substream,
        case SNDRV_PCM_TRIGGER_STOP:
        case SNDRV_PCM_TRIGGER_SUSPEND:
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-               dev->active--;
+               if (dev->active > 0)
+                       dev->active--;
                i2s_stop(dev, substream);
                break;
        default: