From patchwork Sun Jul 7 05:20:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11034047 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 D500E138D for ; Sun, 7 Jul 2019 05:24:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C25FC26CFF for ; Sun, 7 Jul 2019 05:24:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5A922837E; Sun, 7 Jul 2019 05:24:39 +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 1415226CFF for ; Sun, 7 Jul 2019 05:24:39 +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 4D72A1682; Sun, 7 Jul 2019 07:23:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4D72A1682 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1562477077; bh=t/5iprNKxX0DBIra6xaQY79q61rJ/LeWlKazp+k4mxA=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TSqCHvfKGsV/3ZiMOHtFJ/vBkNegiiYb6CSJ6NmuHdmCfkCoL2WRM1GrJJcHiDOBP Mbm3OmISO91CYNbZ5F+H51wBJ1jWNAmLt8Xbqefnp64REEuNWHYBq/gx1ytW7ZZV0t h/nqC8yVcTxNKY7Syil0Fys5YtH1tL4bE65W0+JI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9AC75F802BE; Sun, 7 Jul 2019 07:20:40 +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 27FD4F80269; Sun, 7 Jul 2019 07:20:35 +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 5F64EF800E3 for ; Sun, 7 Jul 2019 07:20:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5F64EF800E3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="VQUl7G6j"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="edBKh9Cv" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 2A1CF446; 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=CKRmcqQ/fYz7w 1wFbtiDYW9BE9i4AHZ4+BTsCGePwZM=; b=VQUl7G6jXWQZXTt+emgKmEDNXMuQS Xjtvlo36zhjmi2/jwiqaSIhgU9VMpHnqAAMWS9jonaBdX7w6qgEGZel6QemzAxwA v7ZxIQnGeCXB45/4ihpQpe/7k2qTtp05ZVYIlwTYk/texfbZfWFGHVSSb0eHlt5R TliepI0MgqjV7yAxOdYwjHzexpE8o+24Clzp9jgfde81Kuc39cW2PKDNnuqqVkJN TXtgcnJ3UsjhhuF7DvrPkw5U+4eeZD9z3g5GOgavew7cQwTNEXSDpy9xZqlb8V9B ZXmyStT5Z6YGeFY7Y3Dwdriv5HO0MJJDBIkAvxtaen9k8drErh7VfUklg== 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=CKRmcqQ/fYz7w1wFbtiDYW9BE9i4AHZ4+BTsCGePwZM=; b=edBKh9Cv Pq8pM6Ak++iN9cQntvLekBJT7VEzjaNA+2W3rgMk0Pf/1dj0NgquIhqk5yQ3B29S VK0bxRelW8OVso7BQ+IFIkhcDM7PLiUPk9loKz3kTcWFV48BuYtJ1enov6m8uMQa 4D/38OEwcSQWZXMxGSYleK9gr9R9u+kYYRAffWW6ynPRVZBpQ+7UOGdzIqS5lbPy yYG+QcUSEqY4U3MxMRU43y3OzRX463B8WA/Qtfag9SOFPOLEzcGFTBQ6ru09hIZb CJTE+TFOndjqnQw1bUySDONjjFJk1dnf+BLh2JIdElED0QCASqTPPrKr22yL4kfL ZCfmDnjrY+V+1w== 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 DCB7080059; Sun, 7 Jul 2019 01:20:17 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 7 Jul 2019 14:20:07 +0900 Message-Id: <20190707052011.24687-3-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 2/6] ALSA: fireworks: 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 fireworks 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: 3d7250667ea9 ("ALSA: fireworks: configure sampling transfer frequency in pcm.hw_params callback") Signed-off-by: Takashi Sakamoto --- sound/firewire/fireworks/fireworks_midi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/firewire/fireworks/fireworks_midi.c b/sound/firewire/fireworks/fireworks_midi.c index 6d3d942e2dce..fd17777981e4 100644 --- a/sound/firewire/fireworks/fireworks_midi.c +++ b/sound/firewire/fireworks/fireworks_midi.c @@ -22,6 +22,8 @@ static int midi_open(struct snd_rawmidi_substream *substream) if (err >= 0) { ++efw->substreams_counter; err = snd_efw_stream_start_duplex(efw); + if (err < 0) + --efw->substreams_counter; } mutex_unlock(&efw->mutex); if (err < 0)