ASoC: SOF: trace: fix unconditional free in trace release
authorKai Vehmanen <kai.vehmanen@linux.intel.com>
Fri, 24 Jan 2020 21:36:22 +0000 (15:36 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2020 14:33:05 +0000 (16:33 +0200)
commitca958fe8af205e900cab8d2793c54fabc04c0f94
treedf57715113ab689c4cbf7fddda6d2f517d29d2e0
parent01fad934f1bdca50a952b3347f4e234a3e1e4ff8
ASoC: SOF: trace: fix unconditional free in trace release

[ Upstream commit e6110114d18d330c05fd6de9f31283fd086a5a3a ]

Check if DMA pages were successfully allocated in initialization
before calling free. For many types of memory (like sgbufs)
the extra free is harmless, but not all backends track allocation
state, so add an explicit check.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200124213625.30186-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/sof/trace.c