Skip to content

Commit 79597c8

Browse files
Su Huitiwai
authored andcommitted
ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer
smatch error: sound/pci/ac97/ac97_codec.c:2354 snd_ac97_mixer() error: we previously assumed 'rac97' could be null (see line 2072) remove redundant assignment, return error if rac97 is NULL. Fixes: da3cec3 ("ALSA: Kill snd_assert() in sound/pci/*") Signed-off-by: Su Hui <suhui@nfschina.com> Link: https://lore.kernel.org/r/20230615021732.1972194-1-suhui@nfschina.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 58cc613 commit 79597c8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/pci/ac97/ac97_codec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,8 +2069,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
20692069
.dev_disconnect = snd_ac97_dev_disconnect,
20702070
};
20712071

2072-
if (rac97)
2073-
*rac97 = NULL;
2072+
if (!rac97)
2073+
return -EINVAL;
20742074
if (snd_BUG_ON(!bus || !template))
20752075
return -EINVAL;
20762076
if (snd_BUG_ON(template->num >= 4))

0 commit comments

Comments
 (0)