diff options
author | Gary Bisson <gary.bisson@boundarydevices.com> | 2018-10-02 15:10:19 +0200 |
---|---|---|
committer | Gary Bisson <gary.bisson@boundarydevices.com> | 2018-10-02 15:10:19 +0200 |
commit | c98b0c5db65001d10d7f0af026801b9c193c369e (patch) | |
tree | f10a85be5659f9b2f8f3ca4aff41d8fd3aa01b37 /sound/core | |
parent | cc9333d7aace5c1de4e81932870b53bb6614dedd (diff) | |
parent | 46f9f7c3c326389d5765c28f120fead6cc068e67 (diff) |
Merge tag 'v4.9.130' into 4.9-2.3.x-imx
This is the 4.9.130 stable release
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/pcm_lib.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 9306604f5070..f57a58ac7ae0 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -648,27 +648,33 @@ EXPORT_SYMBOL(snd_interval_refine); static int snd_interval_refine_first(struct snd_interval *i) { + const unsigned int last_max = i->max; + if (snd_BUG_ON(snd_interval_empty(i))) return -EINVAL; if (snd_interval_single(i)) return 0; i->max = i->min; - i->openmax = i->openmin; - if (i->openmax) + if (i->openmin) i->max++; + /* only exclude max value if also excluded before refine */ + i->openmax = (i->openmax && i->max >= last_max); return 1; } static int snd_interval_refine_last(struct snd_interval *i) { + const unsigned int last_min = i->min; + if (snd_BUG_ON(snd_interval_empty(i))) return -EINVAL; if (snd_interval_single(i)) return 0; i->min = i->max; - i->openmin = i->openmax; - if (i->openmin) + if (i->openmax) i->min--; + /* only exclude min value if also excluded before refine */ + i->openmin = (i->openmin && i->min <= last_min); return 1; } |