Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (6 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/hda/hdmi_chmap.c

    r709 r772  
    761761}
    762762
     763/* a simple sanity check for input values to chmap kcontrol */
     764static int chmap_value_check(struct hdac_chmap *hchmap,
     765                             const struct snd_ctl_elem_value *ucontrol)
     766{
     767        int i;
     768
     769        for (i = 0; i < hchmap->channels_max; i++) {
     770                if (ucontrol->value.integer.value[i] < 0 ||
     771                    ucontrol->value.integer.value[i] > SNDRV_CHMAP_LAST)
     772                        return -EINVAL;
     773        }
     774        return 0;
     775}
     776
    763777static int hdmi_chmap_ctl_put(struct snd_kcontrol *kcontrol,
    764778                              struct snd_ctl_elem_value *ucontrol)
     
    772786        int i, err, ca, prepared = 0;
    773787
     788        err = chmap_value_check(hchmap, ucontrol);
     789        if (err < 0)
     790                return err;
     791
    774792        /* No monitor is connected in dyn_pcm_assign.
    775793         * It's invalid to setup the chmap
     
    782800        if (!substream || !substream->runtime)
    783801                return 0; /* just for avoiding error from alsactl restore */
    784         switch (substream->runtime->status->state) {
     802        switch (substream->runtime->state) {
    785803        case SNDRV_PCM_STATE_OPEN:
    786804        case SNDRV_PCM_STATE_SETUP:
Note: See TracChangeset for help on using the changeset viewer.