lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 21 Feb 2024 15:05:00 +0000
From: Richard Fitzgerald <rf@...nsource.cirrus.com>
To: <broonie@...nel.org>, <tiwai@...e.com>
CC: <linux-sound@...r.kernel.org>, <alsa-devel@...a-project.org>,
        <linux-kernel@...r.kernel.org>, <patches@...nsource.cirrus.com>,
        "Simon
 Trimmer" <simont@...nsource.cirrus.com>,
        Richard Fitzgerald
	<rf@...nsource.cirrus.com>
Subject: [PATCH 2/9] ALSA: hda: hda_cs_dsp_ctl: Only call notify when a control has been added to a card

From: Simon Trimmer <simont@...nsource.cirrus.com>

There is a window of time where the cs_dsp_coeff_ctl has been created
but has not been registered as a control with ALSA.

The hda_cs_dsp_write_ctl() helper function can be used update the cs_dsp
coefficient before it has been registered, but it should only call
snd_ctl_notify() once the control is associated with a card.

Signed-off-by: Simon Trimmer <simont@...nsource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@...nsource.cirrus.com>
Fixes: e414b05e724f ("ALSA: hda: hda_cs_dsp_ctl: Add apis to write the controls directly")
---
 sound/pci/hda/hda_cs_dsp_ctl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/hda_cs_dsp_ctl.c b/sound/pci/hda/hda_cs_dsp_ctl.c
index 463ca06036bf..0f5fdd44721c 100644
--- a/sound/pci/hda/hda_cs_dsp_ctl.c
+++ b/sound/pci/hda/hda_cs_dsp_ctl.c
@@ -224,9 +224,10 @@ int hda_cs_dsp_write_ctl(struct cs_dsp *dsp, const char *name, int type,
 	if (ret == 0 || (cs_ctl->flags & WMFW_CTL_FLAG_SYS))
 		return 0;
 
+	/* Notify when a control has been added to a card */
 	ctl = cs_ctl->priv;
-
-	snd_ctl_notify(ctl->card, SNDRV_CTL_EVENT_MASK_VALUE, &ctl->kctl->id);
+	if (ctl && ctl->kctl)
+		snd_ctl_notify(ctl->card, SNDRV_CTL_EVENT_MASK_VALUE, &ctl->kctl->id);
 
 	return 0;
 }
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ