aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/codecs/rt298.c
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2016-05-12 09:38:49 +0530
committerMark Brown <broonie@kernel.org>2016-05-12 15:25:58 +0100
commitbb7cb54b388d8d0fbb3af27f14b121ee9c92e867 (patch)
treed2b8e4c0db9e87a7e4cb3d89a7a6d6b723fc3e04 /sound/soc/codecs/rt298.c
parentLinux 4.6-rc1 (diff)
downloadwireguard-linux-bb7cb54b388d8d0fbb3af27f14b121ee9c92e867.tar.xz
wireguard-linux-bb7cb54b388d8d0fbb3af27f14b121ee9c92e867.zip
ASoC: rt298: fix null deref on acpi driver data
ACPI driver data can be NULL so we need to check that before dereference the driver data. Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt298.c')
-rw-r--r--sound/soc/codecs/rt298.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c
index f0e6c06e89ac..52aacb1d5e4c 100644
--- a/sound/soc/codecs/rt298.c
+++ b/sound/soc/codecs/rt298.c
@@ -1184,7 +1184,7 @@ static int rt298_i2c_probe(struct i2c_client *i2c,
/* enable jack combo mode on supported devices */
acpiid = acpi_match_device(dev->driver->acpi_match_table, dev);
- if (acpiid) {
+ if (acpiid && acpiid->driver_data) {
rt298->pdata = *(struct rt298_platform_data *)
acpiid->driver_data;
}