alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: pierre-louis.bossart@linux.intel.com,
	alsa-devel@alsa-project.org, tiwai@suse.com, lgirdwood@gmail.com,
	vkoul@kernel.org, Mark Brown <broonie@kernel.org>
Subject: Applied "ASoC: Intel: Skylake: Shield against no-NHLT configurations" to the asoc tree
Date: Tue, 10 Mar 2020 17:44:51 +0000	[thread overview]
Message-ID: <applied-20200305145314.32579-5-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20200305145314.32579-5-cezary.rojewski@intel.com>

The patch

   ASoC: Intel: Skylake: Shield against no-NHLT configurations

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 9e6c382f5a6161eb55115fb56614b9827f2e7da3 Mon Sep 17 00:00:00 2001
From: Cezary Rojewski <cezary.rojewski@intel.com>
Date: Thu, 5 Mar 2020 15:53:11 +0100
Subject: [PATCH] ASoC: Intel: Skylake: Shield against no-NHLT configurations

Some configurations expose no NHLT table at all within their
/sys/firmware/acpi/tables. To prevent NULL-dereference errors from
occurring, adjust probe flow and append additional safety checks in
functions involved in NHLT lifecycle.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200305145314.32579-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-nhlt.c | 3 ++-
 sound/soc/intel/skylake/skl.c      | 9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c
index 19f328d71f24..d9c8f5cb389e 100644
--- a/sound/soc/intel/skylake/skl-nhlt.c
+++ b/sound/soc/intel/skylake/skl-nhlt.c
@@ -182,7 +182,8 @@ void skl_nhlt_remove_sysfs(struct skl_dev *skl)
 {
 	struct device *dev = &skl->pci->dev;
 
-	sysfs_remove_file(&dev->kobj, &dev_attr_platform_id.attr);
+	if (skl->nhlt)
+		sysfs_remove_file(&dev->kobj, &dev_attr_platform_id.attr);
 }
 
 /*
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index e2e531c96dd1..7ad8a75759bd 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -633,6 +633,9 @@ static int skl_clock_device_register(struct skl_dev *skl)
 	struct platform_device_info pdevinfo = {NULL};
 	struct skl_clk_pdata *clk_pdata;
 
+	if (!skl->nhlt)
+		return 0;
+
 	clk_pdata = devm_kzalloc(&skl->pci->dev, sizeof(*clk_pdata),
 							GFP_KERNEL);
 	if (!clk_pdata)
@@ -1074,7 +1077,8 @@ static int skl_probe(struct pci_dev *pci,
 out_clk_free:
 	skl_clock_device_unregister(skl);
 out_nhlt_free:
-	intel_nhlt_free(skl->nhlt);
+	if (skl->nhlt)
+		intel_nhlt_free(skl->nhlt);
 out_free:
 	skl_free(bus);
 
@@ -1123,7 +1127,8 @@ static void skl_remove(struct pci_dev *pci)
 	skl_dmic_device_unregister(skl);
 	skl_clock_device_unregister(skl);
 	skl_nhlt_remove_sysfs(skl);
-	intel_nhlt_free(skl->nhlt);
+	if (skl->nhlt)
+		intel_nhlt_free(skl->nhlt);
 	skl_free(bus);
 	dev_set_drvdata(&pci->dev, NULL);
 }
-- 
2.20.1


  parent reply	other threads:[~2020-03-10 17:47 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05 14:53 [PATCH 0/7] ASoC: Intel: Skylake: Fix HDaudio and Dmic Cezary Rojewski
2020-03-05 14:53 ` [PATCH 1/7] ASoC: Intel: Skylake: Remove superfluous chip initialization Cezary Rojewski
2020-03-06 20:52   ` Pierre-Louis Bossart
2020-03-09 13:57     ` Cezary Rojewski
2020-03-09 16:48       ` Pierre-Louis Bossart
2020-03-09 17:43         ` Cezary Rojewski
2020-03-09 18:41           ` Pierre-Louis Bossart
2020-03-10 17:45   ` Applied "ASoC: Intel: Skylake: Remove superfluous chip initialization" to the asoc tree Mark Brown
2020-03-05 14:53 ` [PATCH 2/7] ASoC: Intel: Skylake: Select hda configuration permissively Cezary Rojewski
2020-03-06 20:57   ` Pierre-Louis Bossart
2020-03-09 13:47     ` Cezary Rojewski
2020-03-09 17:03       ` Pierre-Louis Bossart
2020-03-10  9:30         ` Cezary Rojewski
2020-03-10 17:45   ` Applied "ASoC: Intel: Skylake: Select hda configuration permissively" to the asoc tree Mark Brown
2020-03-05 14:53 ` [PATCH 3/7] ASoC: Intel: Skylake: Enable codec wakeup during chip init Cezary Rojewski
2020-03-10 17:44   ` Applied "ASoC: Intel: Skylake: Enable codec wakeup during chip init" to the asoc tree Mark Brown
2020-03-05 14:53 ` [PATCH 4/7] ASoC: Intel: Skylake: Shield against no-NHLT configurations Cezary Rojewski
2020-03-06 21:03   ` Pierre-Louis Bossart
2020-03-09 13:03     ` Cezary Rojewski
2020-03-09 17:01       ` Pierre-Louis Bossart
2020-03-09 17:38         ` Cezary Rojewski
2020-03-09 18:40           ` Pierre-Louis Bossart
2020-03-10 17:44   ` Mark Brown [this message]
2020-03-05 14:53 ` [PATCH 5/7] ASoC: Intel: skl_hda_dsp: Enable Dmic configuration Cezary Rojewski
2020-03-06 14:46   ` Kai Vehmanen
2020-03-06 15:49     ` Pierre-Louis Bossart
2020-03-06 19:05       ` Cezary Rojewski
2020-03-06 19:49         ` Pierre-Louis Bossart
2020-03-06 19:58           ` Cezary Rojewski
2020-03-05 14:53 ` [PATCH 6/7] ASoC: Intel: Allow for ROM init retry on CNL platforms Cezary Rojewski
2020-03-10 17:44   ` Applied "ASoC: Intel: Allow for ROM init retry on CNL platforms" to the asoc tree Mark Brown
2020-03-05 14:53 ` [PATCH 7/7] ASoC: Intel: Skylake: Await purge request ack on CNL Cezary Rojewski
2020-03-10 17:44   ` Applied "ASoC: Intel: Skylake: Await purge request ack on CNL" to the asoc tree Mark Brown
2020-03-06 20:48 ` [PATCH 0/7] ASoC: Intel: Skylake: Fix HDaudio and Dmic Pierre-Louis Bossart
2020-03-09 11:38   ` Mark Brown
2020-03-09 14:02     ` Cezary Rojewski
2020-03-09 16:54       ` Mark Brown
2020-03-09 17:48         ` Cezary Rojewski
2020-03-09 17:52           ` Mark Brown
2020-03-10 16:03         ` Pierre-Louis Bossart
     [not found]           ` <2dc38392-760b-a5fc-fa00-98530729f2d3@intel.com>
2020-03-11 16:56             ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=applied-20200305145314.32579-5-cezary.rojewski@intel.com \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=cezary.rojewski@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).