Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3536320imu; Mon, 7 Jan 2019 05:15:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/VdzkRgib1lQoI00eWibfzTISCjN/WVcRRJQoTejpZRt0Sm95OiOTSJYSK41rkvPZw97ZlK X-Received: by 2002:a62:cf84:: with SMTP id b126mr62338904pfg.98.1546866943980; Mon, 07 Jan 2019 05:15:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546866943; cv=none; d=google.com; s=arc-20160816; b=xoMaUVEd1GSrik4/GR/324HktjZq1husAWGqmIuRRncfOw3L1/329STOTCZOI81VAs 7IFNz5uMCxu+8txGP4+zVovb1HtnSQVwM8VS85o7gWX+iq543Q+D64UoOS7WVKYEpVMz VB2DAajWMgpC9j1JXcMGMhHq2auHEDYBlNI1L1BMFw/241tfoZCTgozlz9MX4FDZfk38 Q+bfAowwQj/jkJ0oWeNubRnwV2oealKM48zHiI59kqIk9QfA/xGvdZGT11QBTxyeX7tb Y6rakyT8mKrzW/r2D2uX6wHuk4qLT7EslTNGZ5Vgv7mLbsI16+yU4iSkKC1IZqKNM+Hw kNvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hhpOBRtSIoopotzLoupM2NxKTDNXYazUSksbqWv4mao=; b=LYn0TXDc4FBnViIrn3GhtLLhMKjBG+nNVezEhRKFUEHOUAdGCT6ZaEWlsro6CFPifZ LS4PxezBzwUS52MoND0XHkpk7n5hR4FI1bPYmG/tkTZIoc382+SWWGyc4TYcJjBBNeKW icBxFIF4mqjQgRPZTvUyuACRr5FdIN0symt7ACM2VfMaBUoUkwrfPcQwl7eSYMuRSOh9 bgZjxDeuw8xOcsgwVePdsGFNyd/yZwOTTo68Pp9ifdvDH1SUPusOxTnTU7oQd54WBE9F krhGyU0+YAo37kxG2qwkfPQryMdGeWE5o/4/DqyNHU7Wet8rXoZH3yDcLU2byC39K+EO qjiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QirjeIJl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k16si58977191pls.124.2019.01.07.05.15.28; Mon, 07 Jan 2019 05:15:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QirjeIJl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731029AbfAGNDf (ORCPT + 99 others); Mon, 7 Jan 2019 08:03:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:50972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727684AbfAGNDa (ORCPT ); Mon, 7 Jan 2019 08:03:30 -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 1872C2089F; Mon, 7 Jan 2019 13:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866209; bh=gdRmi6FI7vC9olQkzZHX9ujkVTVzq4otTvPMd5kVmp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QirjeIJl+nTANXMxPlmC1q1/VazFAuKzvlBAvuTV/+78RVVhKof4YkvnVhCBCd3aB d5dfWwvdcQthW2SsOmSiDhVmwTljpfXcfUb/LoXWCiKEex0YGSoawUGiDnEp3ojOgJ G+H3e19e8T7Rc1WevJEsCjAGBzb7Z75xrIsqj1i8= 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.14 045/101] ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet Date: Mon, 7 Jan 2019 13:32:33 +0100 Message-Id: <20190107105335.367011522@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-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,