diff options
author | Cezary Rojewski <cezary.rojewski@intel.com> | 2020-03-05 15:53:11 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-03-10 17:44:27 +0000 |
commit | 9e6c382f5a6161eb55115fb56614b9827f2e7da3 (patch) | |
tree | a3809bc5b9e42a4c0212b1fc1c7729fdb4d500c9 /sound/soc/intel/skylake/skl-nhlt.c | |
parent | e603f11d5df8997d104ab405ff27640b90baffaa (diff) | |
download | lwn-9e6c382f5a6161eb55115fb56614b9827f2e7da3.tar.gz lwn-9e6c382f5a6161eb55115fb56614b9827f2e7da3.zip |
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>
Diffstat (limited to 'sound/soc/intel/skylake/skl-nhlt.c')
-rw-r--r-- | sound/soc/intel/skylake/skl-nhlt.c | 3 |
1 files changed, 2 insertions, 1 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); } /* |