This is a note to let you know that I've just added the patch titled ALSA: control_led - fix initialization in the mode show callback to the 5.13-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-control_led-fix-initialization-in-the-mode-show.patch and it can be found in the queue-5.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit a6cb387a98be6dc35d3e4d01b394dec14fd2d77c Author: Jaroslav Kysela <perex@xxxxxxxx> Date: Mon Jun 14 09:17:10 2021 +0200 ALSA: control_led - fix initialization in the mode show callback [ Upstream commit e381a14c3e3a4e90e293d4eaa5a3ab8ae98b9973 ] The str variable should be always initialized before use even if the switch covers all cases. This is a minimalistic fix: Assign NULL, the sprintf() may print '(null)' if something is corrupted. Signed-off-by: Jaroslav Kysela <perex@xxxxxxxx> Link: https://lore.kernel.org/r/20210614071710.1786866-1-perex@xxxxxxxx Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/sound/core/control_led.c b/sound/core/control_led.c index a90e31dbde61..ff7fd5e29551 100644 --- a/sound/core/control_led.c +++ b/sound/core/control_led.c @@ -397,7 +397,7 @@ static ssize_t show_mode(struct device *dev, struct device_attribute *attr, char *buf) { struct snd_ctl_led *led = container_of(dev, struct snd_ctl_led, dev); - const char *str; + const char *str = NULL; switch (led->mode) { case MODE_FOLLOW_MUTE: str = "follow-mute"; break;