提交 bb7cb54b 编写于 作者: V Vinod Koul 提交者: Mark Brown

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: NSenthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
Acked-by: NBard Liao <bardliao@realtek.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 f55532a0
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册