lkml.org 
[lkml]   [2018]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 28/51] ALSA: pcm: Fix interval evaluation with openmin/max
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Takashi Iwai <tiwai@suse.de>

    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: <stable@vger.kernel.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    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;
    }


    \
     
     \ /
      Last update: 2018-12-11 17:12    [W:5.987 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site