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]
Date:	Tue, 13 Oct 2015 21:37:57 +0800
From:	Koro Chen <koro.chen@...iatek.com>
To:	<broonie@...nel.org>, <perex@...ex.cz>, <tiwai@...e.de>,
	<lgirdwood@...il.com>
CC:	<srv_heupstream@...iatek.com>,
	<linux-mediatek@...ts.infradead.org>, <s.hauer@...gutronix.de>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <alsa-devel@...a-project.org>,
	<lars@...afoo.de>, <p.zabel@...gutronix.de>,
	Koro Chen <koro.chen@...iatek.com>
Subject: [RFC PATCH] ASoC: Modify check condition of multiple bindings of components

The patch "ASoC: Prevent components from being bound to multiple cards"
adds check to prevent multiple cards from using the same component.
However, snd_soc_register_platform() or snd_soc_register_codec() will
also create components, and sharing the same platform by multiple cards
is then refused. This happens with a platform having multiple
independent DAIs that share the same DMA controller.

Relax the condition by checking component->registered_as_component,
which is only true in case of snd_soc_register_component() and
will be false for components created by snd_soc_register_platform()
or snd_soc_register_codec().

Signed-off-by: Koro Chen <koro.chen@...iatek.com>
---
 sound/soc/soc-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 42575b0..eca169a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
 		return 0;
 
 	if (component->card) {
-		if (component->card != card) {
+		if (component->card != card &&
+		    component->registered_as_component) {
 			dev_err(component->dev,
 				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
 				card->name, component->card->name);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ