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:	Fri, 15 May 2015 10:38:27 +0100
From:	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:	alsa-devel@...a-project.org
Cc:	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>,
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
	linux-kernel@...r.kernel.org,
	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH] ASoC: skip legacy dai naming if dai driver has all the information

Original issue is that the id field in the dai is not same as the id
in dai_driver when dai driver count == 1. This is due to the legacy
dai naming check, which could possibly cause issues if the audio drivers
written in assumption that dai->id would be always equal to dai_driver->id.
This assumption is true only if the dai driver count is greater than 1,
and false if dai driver count is 1. On Qcom Lpass driver we hit such
issue while adding support to apq8016.

The code path which falls back to legacy naming for cases where num_dai
== 1 does not check if there is any valid information in the dai_driver.
This patch fixes that by checking if the dai_driver has valid id and
name before falling back to legacy dai naming
Although the drivers can work around this issue by only using
dai->driver->id, but this patch attempts to fix the actual issue.

Suggested-by: Lars-Peter Clausen <lars@...afoo.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
 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 2373252..7d028e8 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2599,7 +2599,8 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
 		 * the same naming style even though those DAIs are not
 		 * component-less anymore.
 		 */
-		if (count == 1 && legacy_dai_naming) {
+		if (count == 1 && legacy_dai_naming &&
+			(dai_drv[i].id == 0 || dai_drv[i].name == NULL)) {
 			dai->name = fmt_single_name(dev, &dai->id);
 		} else {
 			dai->name = fmt_multiple_name(dev, &dai_drv[i]);
-- 
1.9.1

--
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