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

Commit 09318c47 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown
Browse files

ASoC: Fix null dereference in ak4535_remove()

ak4535_remove() from sound/soc/codecs/ak4535.c calls
i2c_unregister_device() with a possibly null pointer.

This bug was found by smatch (http://repo.or.cz/w/smatch.git/

).

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 103f211d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -659,6 +659,7 @@ static int ak4535_remove(struct platform_device *pdev)
	snd_soc_free_pcms(socdev);
	snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
	if (codec->control_data)
		i2c_unregister_device(codec->control_data);
	i2c_del_driver(&ak4535_i2c_driver);
#endif