ALSA: hda: intel-sdw-acpi: harden detection of controller
authorLibin Yang <libin.yang@intel.com>
Tue, 21 Dec 2021 01:08:16 +0000 (09:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jan 2022 11:42:33 +0000 (12:42 +0100)
commitcce476954401e3421afafb25bbaa926050688b1d
treed8bc1e1aa75321035f99579436b93f04c6cf3515
parent62f0a61fcb8a05302d2e5f0433b06f52729a214c
ALSA: hda: intel-sdw-acpi: harden detection of controller

[ Upstream commit 385f287f9853da402d94278e59f594501c1d1dad ]

The existing code currently sets a pointer to an ACPI handle before
checking that it's actually a SoundWire controller. This can lead to
issues where the graph walk continues and eventually fails, but the
pointer was set already.

This patch changes the logic so that the information provided to
the caller is set when a controller is found.

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211221010817.23636-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/hda/intel-sdw-acpi.c