From: Vinod Koul Date: Thu, 12 May 2016 04:08:49 +0000 (+0530) Subject: ASoC: rt298: fix null deref on acpi driver data X-Git-Tag: v4.7-rc1~11^2~7^2~11^5~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb7cb54b388d8d0fbb3af27f14b121ee9c92e867;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Vinod Koul Acked-by: Bard Liao Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index f0e6c06..52aacb1 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; }