From: Takashi Iwai Date: Wed, 16 Sep 2026 12:59:32 +0000 (+0200) Subject: alsa-info: Don't access non-existing module parameters X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=cd6c92333b735ec93dea45731671d263601bc464;p=alsa-utils.git alsa-info: Don't access non-existing module parameters Some modules are without any parameters, and there are no "parameters" subdirectories for such modules. Since alsa-info.sh tries to access modules/* files, this results in (non-fatal) errors. Add the check of the parameters subdirectory before accessing the actual parameter files for avoiding such errors. Link: https://bugzilla.suse.com/show_bug.cgi?id=1279431 Signed-off-by: Takashi Iwai --- diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh index 1628e60..eac3694 100755 --- a/alsa-info/alsa-info.sh +++ b/alsa-info/alsa-info.sh @@ -664,11 +664,13 @@ if [ -d "$SYSFS" ]; then echo "" >> $FILE for mod in $(cat /proc/asound/modules | awk '{ print $2 }'); do echo "!!Module: $mod" >> $FILE - for params in $(echo $SYSFS/module/$mod/parameters/*); do - echo -ne "\t" - value=$(cat $params) - echo "$params : $value" | sed 's:.*/::' - done >> $FILE + if [ -d "$SYSFS/module/$mod/parameters" ]; then + for params in $(echo $SYSFS/module/$mod/parameters/*); do + echo -ne "\t" + value=$(cat $params) + echo "$params : $value" | sed 's:.*/::' + done >> $FILE + fi echo "" >> $FILE done echo "" >> $FILE