From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Takashi Iwai <tiwai@suse.de>,
Mark Brown <broonie@kernel.org>,
Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH 4.4 32/44] ASoC: DAPM: Fix missing kctl change notifications
Date: Mon, 25 Oct 2021 21:14:13 +0200 [thread overview]
Message-ID: <20211025190935.238114232@linuxfoundation.org> (raw)
In-Reply-To: <20211025190928.054676643@linuxfoundation.org>
From: Takashi Iwai <tiwai@suse.de>
commit 5af82c81b2c49cfb1cad84d9eb6eab0e3d1c4842 upstream.
The put callback of a kcontrol is supposed to return 1 when the value
is changed, and this will be notified to user-space. However, some
DAPM kcontrols always return 0 (except for errors), hence the
user-space misses the update of a control value.
This patch corrects the behavior by properly returning 1 when the
value gets updated.
Reported-and-tested-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20211006141712.2439-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/soc-dapm.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2377,6 +2377,7 @@ static int snd_soc_dapm_set_pin(struct s
const char *pin, int status)
{
struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true);
+ int ret = 0;
dapm_assert_locked(dapm);
@@ -2389,13 +2390,14 @@ static int snd_soc_dapm_set_pin(struct s
dapm_mark_dirty(w, "pin configuration");
dapm_widget_invalidate_input_paths(w);
dapm_widget_invalidate_output_paths(w);
+ ret = 1;
}
w->connected = status;
if (status == 0)
w->force = 0;
- return 0;
+ return ret;
}
/**
@@ -3290,14 +3292,15 @@ int snd_soc_dapm_put_pin_switch(struct s
{
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
const char *pin = (const char *)kcontrol->private_value;
+ int ret;
if (ucontrol->value.integer.value[0])
- snd_soc_dapm_enable_pin(&card->dapm, pin);
+ ret = snd_soc_dapm_enable_pin(&card->dapm, pin);
else
- snd_soc_dapm_disable_pin(&card->dapm, pin);
+ ret = snd_soc_dapm_disable_pin(&card->dapm, pin);
snd_soc_dapm_sync(&card->dapm);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch);
@@ -3657,7 +3660,7 @@ static int snd_soc_dapm_dai_link_put(str
w->params_select = ucontrol->value.enumerated.item[0];
- return 0;
+ return 1;
}
int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
next prev parent reply other threads:[~2021-10-25 19:16 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 19:13 [PATCH 4.4 00/44] 4.4.290-rc1 review Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 01/44] ALSA: seq: Fix a potential UAF by wrong private_free call order Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 02/44] s390: fix strrchr() implementation Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 03/44] xhci: Enable trust tx length quirk for Fresco FL11 USB controller Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 04/44] cb710: avoid NULL pointer subtraction Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 05/44] efi/cper: use stack buffer for error record decoding Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 06/44] Input: xpad - add support for another USB ID of Nacon GC-100 Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 07/44] USB: serial: qcserial: add EM9191 QDL support Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 08/44] USB: serial: option: add Telit LE910Cx composition 0x1204 Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 09/44] nvmem: Fix shift-out-of-bound (UBSAN) with byte size cells Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 10/44] iio: adc128s052: Fix the error handling path of adc128_probe() Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 11/44] iio: ssp_sensors: add more range checking in ssp_parse_dataframe() Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 12/44] iio: ssp_sensors: fix error code in ssp_print_mcu_debug() Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 13/44] net: arc: select CRC32 Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 14/44] net: korina: " Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 15/44] net: encx24j600: check error in devm_regmap_init_encx24j600 Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 16/44] ethernet: s2io: fix setting mac address during resume Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 17/44] nfc: fix error handling of nfc_proto_register() Greg Kroah-Hartman
2021-10-25 19:13 ` [PATCH 4.4 18/44] NFC: digital: fix possible memory leak in digital_tg_listen_mdaa() Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 19/44] NFC: digital: fix possible memory leak in digital_in_send_sdd_req() Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 20/44] pata_legacy: fix a couple uninitialized variable bugs Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 21/44] drm/msm: Fix null pointer dereference on pointer edp Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 22/44] r8152: select CRC32 and CRYPTO/CRYPTO_HASH/CRYPTO_SHA256 Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 23/44] NFSD: Keep existing listeners on portlist error Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 24/44] netfilter: ipvs: make global sysctl readonly in non-init netns Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 25/44] NIOS2: irqflags: rename a redefined register name Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 26/44] can: rcar_can: fix suspend/resume Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 27/44] can: peak_usb: pcan_usb_fd_decode_status(): fix back to ERROR_ACTIVE state notification Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 28/44] can: peak_pci: peak_pci_remove(): fix UAF Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 29/44] ocfs2: mount fails with buffer overflow in strlen Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 30/44] elfcore: correct reference to CONFIG_UML Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 31/44] ALSA: usb-audio: Provide quirk for Sennheiser GSP670 Headset Greg Kroah-Hartman
2021-10-25 19:14 ` Greg Kroah-Hartman [this message]
2021-10-25 19:14 ` [PATCH 4.4 33/44] ovl: fix missing negative dentry check in ovl_rename() Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 34/44] nfc: nci: fix the UAF of rf_conn_info object Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 35/44] isdn: cpai: check ctr->cnr to avoid array index out of bound Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 36/44] netfilter: Kconfig: use default y instead of m for bool config option Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 37/44] ARM: dts: spear3xx: Fix gmac node Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 38/44] isdn: mISDN: Fix sleeping function called from invalid context Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 39/44] platform/x86: intel_scu_ipc: Update timeout value in comment Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 40/44] ALSA: hda: avoid write to STATESTS if controller is in reset Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 41/44] usbnet: sanity check for maxpacket Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 42/44] net: mdiobus: Fix memory leak in __mdiobus_register Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 43/44] tracing: Have all levels of checks prevent recursion Greg Kroah-Hartman
2021-10-25 19:14 ` [PATCH 4.4 44/44] ARM: 9122/1: select HAVE_FUTEX_CMPXCHG Greg Kroah-Hartman
2021-10-25 21:36 ` [PATCH 4.4 00/44] 4.4.290-rc1 review Pavel Machek
2021-10-26 9:16 ` Jon Hunter
2021-10-26 17:07 ` Naresh Kamboju
2021-10-26 17:31 ` Shuah Khan
2021-10-26 19:47 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211025190935.238114232@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox