Patch "ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     alsa-ac97-fix-possible-null-dereference-in-snd_ac97_.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 401fe82071fe9d18c5270518f12162afb8d945dc
Author: Su Hui <suhui@xxxxxxxxxxxx>
Date:   Thu Jun 15 10:17:32 2023 +0800

    ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer
    
    [ Upstream commit 79597c8bf64ca99eab385115743131d260339da5 ]
    
    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: da3cec35dd3c ("ALSA: Kill snd_assert() in sound/pci/*")
    Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230615021732.1972194-1-suhui@xxxxxxxxxxxx
    Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index ceead55f13ab1..58ae0c3ce1e49 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -2070,8 +2070,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
 		.dev_disconnect =	snd_ac97_dev_disconnect,
 	};
 
-	if (rac97)
-		*rac97 = NULL;
+	if (!rac97)
+		return -EINVAL;
 	if (snd_BUG_ON(!bus || !template))
 		return -EINVAL;
 	if (snd_BUG_ON(template->num >= 4))



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux