Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp900678imu; Tue, 11 Dec 2018 09:16:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/X2UnOphVA+6zvq+s9hH3xnqC75a9pkibfEX5H7ClJzQFYhJjYRuicFaaVdWBzLgQYVoEgZ X-Received: by 2002:a62:59c9:: with SMTP id k70mr16960534pfj.243.1544548589958; Tue, 11 Dec 2018 09:16:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548589; cv=none; d=google.com; s=arc-20160816; b=LulMik3cGsWhrYOGDpv2vRD7VRVzQQgyY/oEkkiJvcaJfVy0w0JXTyXGajOYAcHhhM vXxYDeddh4enJX1oQznU6HHdiO6iwP1Uknva/UoepV9fN+GdBzusB1ei/1/78cBo+Kuw hsmGMfHQcIkA2WSYsShq74lvCrzj+YzK2qmoQG7Zvfrqsply8E6syo02LaHRMKEl8Y7L aGjvNT2M3XXbpTFYTMjbgbwzIFwenl4ZYKxXgtcrgvN5UbQGzjSIkdCvcAh6fpADfr/V Vz/LHP4kYFWGKA52rx0sJHVWLnzrBpVrzcSp1PI167L/nEqkbQgAswWZIhx0shtXZQlp 3otA== 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=AR0b25jMSGgDkGoHJo6uVK/cO0ikxGOZhqNLUyQnl78=; b=eh2r0PuGf2cALLn55vY3vk+FnDtk5vFcjRZN2AmTpdot+xpA6YSr3fNokZvpvApYh9 oJZgqu3hnXSQzXKfhzfpEZOXp2OSYrkiHKvN8kkUUjQkm0Qzf2bKSPjyM8+J/twEpS9M SU4U8W/UOEx+HqXn/uId/yUtibcxy8ArqsB1gcCuHngIa3dTXfzcI6cVVI7dZHPYKmMp t3bmubs/iZ3KoRt1FKyyWiu+BAE8+VtnpWgBVUEWLCZ3cC4frStHQM8gl8QpsN8XcOND c5Gm2lTkEFkmyUNyZlK5VEoK7t45CB29qpawR77Rwek8dpu63MWNY/fZIO5vUcqKhHvx fsaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oky/TVoc"; 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 b89si13346445pfj.207.2018.12.11.09.16.15; Tue, 11 Dec 2018 09:16:29 -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="oky/TVoc"; 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 S1728674AbeLKPrx (ORCPT + 99 others); Tue, 11 Dec 2018 10:47:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:36252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728152AbeLKPru (ORCPT ); Tue, 11 Dec 2018 10:47:50 -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 0CF5E20989; Tue, 11 Dec 2018 15:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543269; bh=SApW4XrJIda38W+MDnq98peXuwKoRZXg5tvpP02SKog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oky/TVoc5pRxbsOjQOhbYpFV6n3rwZPb0B3pJcf3OqFcKhiF+EvOBvyPwf5+Bwx4/ YZQGX6kwcBXDOOsuL6bN6BLEE5xvX2H47SollbjOjxd90kZQUEkMwqgqaUoGsDgoNY 4TUya8zAUrKAOQ8VK4PlOxpkFWX6lemXvHp9YtTs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 4.4 77/91] ALSA: pcm: Fix interval evaluation with openmin/max Date: Tue, 11 Dec 2018 16:41:36 +0100 Message-Id: <20181211151612.799803925@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai commit 5363857b916c1f48027e9b96ee8be8376bf20811 upstream. As addressed in alsa-lib (commit b420056604f0), we need to fix the case where the evaluation of PCM interval "(x x+1]" leading to -EINVAL. After applying rules, such an interval may be translated as "(x x+1)". Fixes: ff2d6acdf6f1 ("ALSA: pcm: Fix snd_interval_refine first/last with open min/max") Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- include/sound/pcm_params.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h @@ -247,11 +247,13 @@ static inline int snd_interval_empty(con static inline int snd_interval_single(const struct snd_interval *i) { return (i->min == i->max || - (i->min + 1 == i->max && i->openmax)); + (i->min + 1 == i->max && (i->openmin || i->openmax))); } static inline int snd_interval_value(const struct snd_interval *i) { + if (i->openmin && !i->openmax) + return i->max; return i->min; }