From 7ee2331c1e21956509b4622dc26d76c1845793a2 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Fri, 29 Aug 2014 15:02:38 +0100 Subject: [PATCH] ASoC: dwc: Don't allow negative use counts Signed-off-by: Andrew Jackson --- sound/soc/dwc/designware_i2s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index d202c7c..bd2fcd7 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -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: -- 2.7.4