diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 13:14:14 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 13:14:14 +0300 |
| commit | cd5b27c9e334ff91ec39647957a3bdf75f171938 (patch) | |
| tree | 88a95929dde4232e34c61206d24f29ee79d7b34c /sound/soc/soc-ops.c | |
| parent | 7b9069cd1859ed8d1c5c757ca21ec787f75f0029 (diff) | |
| parent | 880e4ff5d6c8dc6b660f163a0e9b68b898cc6310 (diff) | |
| download | linux-rolling-lts.tar.xz | |
Merge v6.12.42linux-rolling-lts
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc/soc-ops.c')
| -rw-r--r-- | sound/soc/soc-ops.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index fb11003d56cf..669b95cb4850 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -642,28 +642,32 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range); static int snd_soc_clip_to_platform_max(struct snd_kcontrol *kctl) { struct soc_mixer_control *mc = (struct soc_mixer_control *)kctl->private_value; - struct snd_ctl_elem_value uctl; + struct snd_ctl_elem_value *uctl; int ret; if (!mc->platform_max) return 0; - ret = kctl->get(kctl, &uctl); + uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); + if (!uctl) + return -ENOMEM; + + ret = kctl->get(kctl, uctl); if (ret < 0) - return ret; + goto out; - if (uctl.value.integer.value[0] > mc->platform_max) - uctl.value.integer.value[0] = mc->platform_max; + if (uctl->value.integer.value[0] > mc->platform_max) + uctl->value.integer.value[0] = mc->platform_max; if (snd_soc_volsw_is_stereo(mc) && - uctl.value.integer.value[1] > mc->platform_max) - uctl.value.integer.value[1] = mc->platform_max; + uctl->value.integer.value[1] > mc->platform_max) + uctl->value.integer.value[1] = mc->platform_max; - ret = kctl->put(kctl, &uctl); - if (ret < 0) - return ret; + ret = kctl->put(kctl, uctl); - return 0; +out: + kfree(uctl); + return ret; } /** |
