From patchwork Sun Jul 7 05:20:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11034039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 177A1138D for ; Sun, 7 Jul 2019 05:21:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F186426CFF for ; Sun, 7 Jul 2019 05:21:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1B882837E; Sun, 7 Jul 2019 05:21:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8323626CFF for ; Sun, 7 Jul 2019 05:21:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C3EA71667; Sun, 7 Jul 2019 07:20:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C3EA71667 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1562476884; bh=d9dw/qWrK3iwsCgJ/xvSi9w8KKFM0sVs4PwxjEoUOIM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TJwPOl7ZU23TD7HfidzWP9QJZSSSYGcUAENMPP/d4EHrj3IM6p+zNDkGpah/wVbqf fcDGck7kUgd4k0GO9hSibL3pkMXwLd77j5/Ca7dmrL/cJjcnDmmMv7TdfKwm0FrJrz aGWgU7z352cuB4xzDGIhN0I7XQIwy4ey3H2uKZw8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 07CE8F801ED; Sun, 7 Jul 2019 07:20:34 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 89A20F80268; Sun, 7 Jul 2019 07:20:30 +0200 (CEST) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 979F7F80213 for ; Sun, 7 Jul 2019 07:20:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 979F7F80213 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="id6JucHP"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="f3dfIWzk" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 2A3E2447; Sun, 7 Jul 2019 01:20:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 07 Jul 2019 01:20:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=DElPb+Qwm8r5D x7+d9vk8I/zQFFq5HFC8qjpggrmIfM=; b=id6JucHP3mZmPv/ssuRL8Jo4mRFRC sO672n0f7t+MKX72CwrxyIGhd68kJRW1zdFmIOCqbb+oz/0wWarlRx+up0/89DSC 2tiPM8GyGFYi/xmNNflyp0h3bLrs5phRJnK+8XYzqmL0rn35fjkz35E+3W92xVIz XYwXfhhWh1LjVTMwaZAtXFdmtHBCVn+jaV8z27QmwAVo30LBkat9Fcp/JX/QK8wo Gb9VbiGFArizZnUfO3Ustb8qzcZOFdbOXIeJRGRhpzl1iKzXB81vDPgcJkScX/RY oTPAsAV37FJ9UdHdfGwvCEmqWlzJuADjvH1/kx33CHsFxxw/PJls+qung== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=DElPb+Qwm8r5Dx7+d9vk8I/zQFFq5HFC8qjpggrmIfM=; b=f3dfIWzk mXG2qHNqj+HmIRMLMnzu0UrGWRZvOAaGnbmounASzytkvIyiIf0buauMBBdfsga+ eJF52N+XLrElJF2qjkhjlEytlxCAZ4Ra7hllvAm+Pn/qY/D0xoz5oXjMtJtFZYwQ V11lnoFa0K8jWPKqmcNw70uhVLJxaaXbZHfVneCoH02DUKvlM5AGBynQRY4vnIhx j9RmHOezjyzyuGeGMDublBk3cKDLLbqw1HUvV5sLEWNiIa3tagRrU6p0W3AZ8Is2 +9mbCu0Zi/2TvQzRfGRpATnPkcfobVEVJP4M9uKob7rJq0Pel6RA3ZVi/jXdgcPe BqKRvg5HmJCFUQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrfeejgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 2DA5880060; Sun, 7 Jul 2019 01:20:15 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 7 Jul 2019 14:20:06 +0900 Message-Id: <20190707052011.24687-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190707052011.24687-1-o-takashi@sakamocchi.jp> References: <20190707052011.24687-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/6] ALSA: bebob: fix wrong reference count for stream functionality at error path of rawmidi interface X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP In IEC 61883-6, several types of sampling data can be multiplexed into payload of common isochronous packet (CIP). For typical audio and music units, PCM samples and MIDI messages are multiplexed into one packet streaming. ALSA bebob driver allows applications of rawmidi interface to start packet streaming for transmission of MIDI messages. However at error path, the reference count of stream functionality is not operated correctly. This can brings a bug that packet streaming is not stopped when all referrers release the count. This commit fixes the bug. Fixes: ac2888b958f2 ("ALSA: bebob: configure sampling transfer frequency in pcm.hw_params callback") Signed-off-by: Takashi Sakamoto --- sound/firewire/bebob/bebob_midi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/firewire/bebob/bebob_midi.c b/sound/firewire/bebob/bebob_midi.c index f7db1f7bce86..f903271e93d0 100644 --- a/sound/firewire/bebob/bebob_midi.c +++ b/sound/firewire/bebob/bebob_midi.c @@ -22,6 +22,8 @@ static int midi_open(struct snd_rawmidi_substream *substream) if (err >= 0) { ++bebob->substreams_counter; err = snd_bebob_stream_start_duplex(bebob); + if (err < 0) + --bebob->substreams_counter; } mutex_unlock(&bebob->mutex); if (err < 0)