android_kernel_motorola_sm6225/sound/pci/ac97
Su Hui ade463bc7d ALSA: ac97: Fix possible error value of *rac97
[ Upstream commit 67de40c9df94037769967ba28c7d951afb45b7fb ]

Before committing 79597c8bf64c, *rac97 always be NULL if there is
an error. When error happens, make sure *rac97 is NULL is safer.

For examble, in snd_vortex_mixer():
	err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
	vortex->isquad = ((vortex->codec == NULL) ?
		0 : (vortex->codec->ext_id&0x80));
If error happened but vortex->codec isn't NULL, this may cause some
problems.

Move the judgement order to be clearer and better.

Fixes: 79597c8bf64c ("ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer")
Suggested-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20230823025212.1000961-1-suhui@nfschina.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 10:48:04 +02:00
..
ac97_codec.c ALSA: ac97: Fix possible error value of *rac97 2023-09-23 10:48:04 +02:00
ac97_id.h ALSA: ac97: add AC97 STMicroelectronics' codecs 2010-01-10 19:03:09 +01:00
ac97_local.h ALSA: ac97: Fix ifdef CONFIG_PROC_FS 2015-05-29 07:52:43 +02:00
ac97_patch.c scripts/spelling.txt: add "swith" pattern and fix typo instances 2017-02-27 18:43:46 -08:00
ac97_patch.h ALSA: ac97: Constify more text arrays 2014-10-21 08:51:45 +02:00
ac97_pcm.c ALSA: ac97: Use standard printk helpers 2014-02-26 16:45:23 +01:00
ac97_proc.c sound: Use octal not symbolic permissions 2018-05-28 11:27:20 +02:00
Makefile ALSA: ac97: Fix ifdef CONFIG_PROC_FS 2015-05-29 07:52:43 +02:00