Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb7cb54b authored by Vinod Koul's avatar Vinod Koul Committed by Mark Brown
Browse files

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: default avatarSenthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Acked-by: default avatarBard Liao <bardliao@realtek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f55532a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}