From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B67FC43387 for ; Mon, 7 Jan 2019 12:50:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 233E8206BB for ; Mon, 7 Jan 2019 12:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546865414; bh=AwrFgdoS0YaN8WyYGJmnwb5iQqhytjo5vz2sP2fRO88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QMAIc3Y+t6BAjwXbjH2zTISlb/UTAK0PSvKLCuW9HtIztTsPACsDCVE8mqULJJwnQ 16jqxX6dUTkDTDgSa6vsqHykSOu1XzMC55bfnSmv9Dpgl/orXrBYbZ0otzqDSDwkiZ bXhg2vla5sHwYF6bYsreJ3U6MAJU35zBlWTIdiZk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728531AbfAGMth (ORCPT ); Mon, 7 Jan 2019 07:49:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:40408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727334AbfAGMte (ORCPT ); Mon, 7 Jan 2019 07:49:34 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 53C16206BB; Mon, 7 Jan 2019 12:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546865373; bh=AwrFgdoS0YaN8WyYGJmnwb5iQqhytjo5vz2sP2fRO88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JNAW6ndEH07VHE4MnoqSiVYxJAWNRyavxUagEPMqS2FPyn6T5uNGO8WzCmEKN5olF qi9BSC9kurAmYEg8j+pjmYUU//9wq0drEOCnd0Oz9aVG7N7t5URHEfJLuoM1bZH+AN m0MA3/mZnNyUEy1Qnjo+ZhgsLDyVAPLzRHB1fuBw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai Subject: [PATCH 4.19 071/170] ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet Date: Mon, 7 Jan 2019 13:31:38 +0100 Message-Id: <20190107104501.406039569@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104452.953560660@linuxfoundation.org> References: <20190107104452.953560660@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Sakamoto commit ada79fa5a0b374dd2c2262137c734da7524a8263 upstream. In IEC 61883-1/6 engine of ALSA firewire stack, a packet handler has a second argument for 'the number of bytes in payload of isochronous packet'. However, an incoming packet handler without CIP header uses the value as 'the number of quadlets in the payload'. This brings userspace applications to receive the number of PCM frames as four times against real time. This commit fixes the bug. Cc: # v4.12+ Fixes: 3b196c394dd ('ALSA: firewire-lib: add no-header packet processing') Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/firewire/amdtp-stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -629,15 +629,17 @@ end: } static int handle_in_packet_without_header(struct amdtp_stream *s, - unsigned int payload_quadlets, unsigned int cycle, + unsigned int payload_length, unsigned int cycle, unsigned int index) { __be32 *buffer; + unsigned int payload_quadlets; unsigned int data_blocks; struct snd_pcm_substream *pcm; unsigned int pcm_frames; buffer = s->buffer.packets[s->packet_index].buffer; + payload_quadlets = payload_length / 4; data_blocks = payload_quadlets / s->data_block_quadlets; trace_in_packet_without_header(s, cycle, payload_quadlets, data_blocks,