ASoC: hdac_hda: fix memleak with regmap not freed on remove
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 17 Jun 2020 16:41:44 +0000 (11:41 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 17 Jun 2020 19:28:30 +0000 (20:28 +0100)
commita94eaccefea1186947c5c5451fcae2245dd7e714
tree0a00032002df1c8c68b042764116daa1be9dcb52
parented1220df6e666500ebf58c4f2fccc681941646fb
ASoC: hdac_hda: fix memleak with regmap not freed on remove

kmemleak throws error reports on module load/unload tests, add
snd_hdac_regmap_exit() in .remove().

While we are at it, also fix the error handling flow in .probe() to
use snd_hdac_regmap_exit() if needed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200617164144.17859-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdac_hda.c