ASoC: SOF: Avoid double decrementing use_count in sof_widget_setup on error
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fri, 27 Jan 2023 12:00:29 +0000 (14:00 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 27 Jan 2023 12:14:12 +0000 (12:14 +0000)
commit955a6f131a50c3685c560ef7b75880d272337b33
treefbb566a27906025e7eec4fbfd5adf27da8f5017e
parent6bc4d1b714aafc0ee3c7649c36aa19998b4c11f9
ASoC: SOF: Avoid double decrementing use_count in sof_widget_setup on error

The sof_widget_free() on the error path will decrement the use count and if
we jump to widget_free: then the use_count will be decremented by two,
which is not correct as we only incremented once with 1.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-17-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-audio.c