]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: Intel: boards: always check the result of acpi_dev_get_first_match_dev()
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 27 Aug 2024 12:32:01 +0000 (20:32 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 28 Aug 2024 12:01:53 +0000 (13:01 +0100)
commit14e91ddd5c02d8c3e5a682ebfa0546352b459911
tree6a1e1917c3d52fb20f18d0db54df46b3315daf0f
parent1ab959bea29c265d7d219346a72ed15b2490d956
ASoC: Intel: boards: always check the result of acpi_dev_get_first_match_dev()

The code seems mostly copy-pasted, with some machine drivers
forgetting to test if the 'adev' result is NULL.

Add this check when missing, and use -ENOENT consistently as an error
code.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/alsa-devel/918944d2-3d00-465e-a9d1-5d57fc966113@stanley.mountain/T/#u
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bytcht_cx2072x.c
sound/soc/intel/boards/bytcht_da7213.c
sound/soc/intel/boards/bytcht_es8316.c
sound/soc/intel/boards/bytcr_rt5640.c
sound/soc/intel/boards/bytcr_rt5651.c
sound/soc/intel/boards/cht_bsw_rt5645.c
sound/soc/intel/boards/cht_bsw_rt5672.c
sound/soc/intel/boards/sof_es8336.c
sound/soc/intel/boards/sof_wm8804.c