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-next>] [day] [month] [year] [list]
Message-ID: <20190201030225.11391-1-jiada_wang@mentor.com>
Date:   Fri, 1 Feb 2019 12:02:25 +0900
From:   Jiada Wang <jiada_wang@...tor.com>
To:     <lgirdwood@...il.com>, <broonie@...nel.org>, <perex@...ex.cz>,
        <tiwai@...e.com>, <kuninori.morimoto.gx@...esas.com>
CC:     <jiada_wang@...tor.com>, <twischer@...adit-jv.com>,
        <alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/1] ASoC: rsnd: allow to register kctrl with different cfg

Currently kctrl with same name can only be created once,
but in "MIX Playback Volume" case, same kctrl is used to
control different MIX volume for different dai-link.

this patch by check kctrl's cfg, allow to create kctrl
with same name but different cfg.

Fixes: commit 9c698e8481a1 ("ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()")

Signed-off-by: Jiada Wang <jiada_wang@...tor.com>
---
 sound/soc/sh/rcar/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 79659f7b32b9..909ee0948da1 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1526,14 +1526,15 @@ int rsnd_kctrl_new(struct rsnd_mod *mod,
 	int ret;
 
 	/*
-	 * 1) Avoid duplicate register (ex. MIXer case)
+	 * 1) Avoid duplicate register (ex. DVC case)
 	 * 2) re-register if card was rebinded
 	 */
 	list_for_each_entry(kctrl, &card->controls, list) {
 		struct rsnd_kctrl_cfg *c = kctrl->private_data;
 
 		if (strcmp(kctrl->id.name, name) == 0 &&
-		    c->mod == mod)
+		    c->mod == mod &&
+		    &c->val == &cfg->val)
 			return 0;
 	}
 
-- 
2.19.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ