diff mbox series

Applied "ASoC: Intel: Skylake: Check for NHLT ACPI header signature" to the asoc tree

Message ID E1eCXy6-0005Wq-VH@debutante
State Accepted
Commit 3b47c9dc75be097bc0e2f3ac4b176fbf3eed85f2
Headers show
Series Applied "ASoC: Intel: Skylake: Check for NHLT ACPI header signature" to the asoc tree | expand

Commit Message

Mark Brown Nov. 8, 2017, 9:33 p.m. UTC
The patch

   ASoC: Intel: Skylake: Check for NHLT ACPI header signature

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 3b47c9dc75be097bc0e2f3ac4b176fbf3eed85f2 Mon Sep 17 00:00:00 2001
From: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>

Date: Tue, 7 Nov 2017 16:16:21 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Check for NHLT ACPI header signature

In certain buggy BIOS acpi_evaluate_dsm() may not return the correct
NHLT table, so check the NHLT table header signature before accessing
it.

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>

Acked-By: Vinod Koul <vinod.koul@intel.com>

Signed-off-by: Mark Brown <broonie@kernel.org>

---
 sound/soc/intel/skylake/skl-nhlt.c | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.15.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
diff mbox series

Patch

diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c
index e7d766d56c8e..d14c50a60289 100644
--- a/sound/soc/intel/skylake/skl-nhlt.c
+++ b/sound/soc/intel/skylake/skl-nhlt.c
@@ -20,6 +20,8 @@ 
 #include <linux/pci.h>
 #include "skl.h"
 
+#define NHLT_ACPI_HEADER_SIG	"NHLT"
+
 /* Unique identification for getting NHLT blobs */
 static guid_t osc_guid =
 	GUID_INIT(0xA69F886E, 0x6CEB, 0x4594,
@@ -45,6 +47,13 @@  struct nhlt_acpi_table *skl_nhlt_init(struct device *dev)
 				memremap(nhlt_ptr->min_addr, nhlt_ptr->length,
 				MEMREMAP_WB);
 		ACPI_FREE(obj);
+		if (nhlt_table && (strncmp(nhlt_table->header.signature,
+					NHLT_ACPI_HEADER_SIG,
+					strlen(NHLT_ACPI_HEADER_SIG)) != 0)) {
+			memunmap(nhlt_table);
+			dev_err(dev, "NHLT ACPI header signature incorrect\n");
+			return NULL;
+		}
 		return nhlt_table;
 	}