From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jackson Subject: Re: [PATCH 2/5] ASoC: dwc: Don't allow negative use counts Date: Thu, 04 Dec 2014 09:07:51 +0000 Message-ID: <54802467.4000702@arm.com> References: <547F3C9F.8080102@arm.com> <20141203172526.GC7712@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by alsa0.perex.cz (Postfix) with ESMTP id F3920260549 for ; Thu, 4 Dec 2014 10:07:51 +0100 (CET) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: rajeev kumar , Mark Brown Cc: "alsa-devel@alsa-project.org" , Takashi Iwai , Liviu Dudau , Liam Girdwood , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" List-Id: alsa-devel@alsa-project.org On 12/04/14 06:43, rajeev kumar wrote: > On Thu, Dec 4, 2014 at 12:10 PM, rajeev kumar > wrote: >> On Wed, Dec 3, 2014 at 10:55 PM, Mark Brown wrote: >>> On Wed, Dec 03, 2014 at 04:38:55PM +0000, Andrew Jackson wrote: >>> >>>> case SNDRV_PCM_TRIGGER_STOP: >>>> case SNDRV_PCM_TRIGGER_SUSPEND: >>>> case SNDRV_PCM_TRIGGER_PAUSE_PUSH: >>>> - dev->active--; >>>> + if (dev->active > 0) >>>> + dev->active--; >>> >>> How is this triggering - this sounds like you're papering over some >>> other bug somewhere? > > This check can be removed as it is not going to triggered. As I said in my email to Mark, I couldn't convince myself that STOP/SUSPEND would only be called once so it seemed like a loophole which /might/ result in the device not functioning correctly. If this can never happen, I'll drop the patch. Andrew > B'rgds > ~Rajeev >