Message ID | 1450867041-729-4-git-send-email-a.hajda@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <alsa-devel-bounces@alsa-project.org> X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6E5B0BEEE5 for <patchwork-alsa-devel@patchwork.kernel.org>; Wed, 23 Dec 2015 10:39:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A77B220461 for <patchwork-alsa-devel@patchwork.kernel.org>; Wed, 23 Dec 2015 10:39:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 2E7602045B for <patchwork-alsa-devel@patchwork.kernel.org>; Wed, 23 Dec 2015 10:39:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 19153265ABE; Wed, 23 Dec 2015 11:39:26 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2EAEE26581E; Wed, 23 Dec 2015 11:39:20 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 509B7265888; Wed, 23 Dec 2015 11:39:18 +0100 (CET) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by alsa0.perex.cz (Postfix) with ESMTP id E8380265062 for <alsa-devel@alsa-project.org>; Wed, 23 Dec 2015 11:39:11 +0100 (CET) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NZT00CHV49638B0@mailout2.w1.samsung.com> for alsa-devel@alsa-project.org; Wed, 23 Dec 2015 10:39:06 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-df-567a79caf0ee Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 15.82.21385.AC97A765; Wed, 23 Dec 2015 10:39:06 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NZT008TT48PPY50@eusync2.samsung.com>; Wed, 23 Dec 2015 10:39:06 +0000 (GMT) From: Andrzej Hajda <a.hajda@samsung.com> To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org> Date: Wed, 23 Dec 2015 11:37:21 +0100 Message-id: <1450867041-729-4-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1450867041-729-1-git-send-email-a.hajda@samsung.com> References: <1450867041-729-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrALMWRmVeSWpSXmKPExsVy+t/xK7qnKqvCDHom8lvcWneO1eLKxUNM FhtnrGe1mPrwCZvFq8O7GC2+Xelgsri8aw6bxdojd9ktOnf1s1ps+L6W0YHLY8PnJjaPnbPu sntsWtXJ5rHv7TI2j29nJrJ49G1ZxeixfstVFo/Pm+QCOKK4bFJSczLLUov07RK4Mm61nGIt 2MVWsWfpY+YGxg2sXYycHBICJhLf915hhrDFJC7cW8/WxcjFISSwlFHi5cGP7CAJIYEmJomT x6VBbDYBTYm/m2+ygdgiAh4Srds3gDUzC8xillhxIx/EFhawkGi9OB2ol4ODRUBV4sxkWZAw r4CjxKqvX6H2ykmcPDYZzOYUcJLo2nyPEWKVo8TJrdsZJzDyLmBkWMUomlqaXFCclJ5rpFec mFtcmpeul5yfu4kREo5fdzAuPWZ1iFGAg1GJh/dFc2WYEGtiWXFl7iFGCQ5mJRHe9HdAId6U xMqq1KL8+KLSnNTiQ4zSHCxK4rwzd70PERJITyxJzU5NLUgtgskycXBKNTCadx/97L6GM+jF k7PT7L8ELIv85XqYz/ebU/vLxF/O9RNYjwgrvjGfamuuolf8YUqgHqv6Nqc5ZqnXpjfM5Tv1 32TDdsU3bEIMZ09F3Cq3PX7x2/4rYnUPkz0kvjyc55GxuvwE68RokXLtrX9VJyg9vJ4nIyO7 wOBvN4/wr5Kktyf/JhYIdXoqsRRnJBpqMRcVJwIAqGJ1SUMCAAA= Cc: alsa-devel@alsa-project.org, Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, open list <linux-kernel@vger.kernel.org>, Takashi Iwai <tiwai@suse.com>, Andrzej Hajda <a.hajda@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com> Subject: [alsa-devel] [PATCH] ASoC: rsnd: fix usrcnt decrementing bug X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" <alsa-devel.alsa-project.org> List-Unsubscribe: <http://mailman.alsa-project.org/mailman/options/alsa-devel>, <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel/> List-Post: <mailto:alsa-devel@alsa-project.org> List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 0b91692..8ca30fd 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -381,9 +381,9 @@ rsnd_ssi_quit_end: rsnd_mod_power_off(mod); - ssi->usrcnt--; - - if (ssi->usrcnt < 0) + if (ssi->usrcnt > 0) + ssi->usrcnt--; + else dev_err(dev, "%s[%d] usrcnt error\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
Field usrcnt is unsigned so it cannot be lesser than zero. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> --- sound/soc/sh/rcar/ssi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)