summaryrefslogtreecommitdiff
path: root/sound/usb
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2022-01-26 21:21:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-08 20:34:07 +0300
commitc2a91f1ef38addab652c3c6752c2a1ce20eeaa89 (patch)
tree675bd8d798268fe6310fe2387caced77bbba1d78 /sound/usb
parent63c69c93d978734edbaa2ba277122aedc7d22a25 (diff)
downloadlinux-c2a91f1ef38addab652c3c6752c2a1ce20eeaa89.tar.xz
ALSA: usb-audio: initialize variables that could ignore errors
commit 3da4b7403db87d39bc2613cfd790de1de99a70ab upstream. clang static analysis reports this representative issue mixer.c:1548:35: warning: Assigned value is garbage or undefined ucontrol->value.integer.value[0] = val; ^ ~~~ The filter_error() macro allows errors to be ignored. If errors can be ignored, initialize variables so garbage will not be used. Fixes: 48cc42973509 ("ALSA: usb-audio: Filter error from connector kctl ops, too") Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20220126182142.1184819-1-trix@redhat.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 8e030b1c061a..567514832b0d 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1496,6 +1496,10 @@ error:
usb_audio_err(chip,
"cannot get connectors status: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",
UAC_GET_CUR, validx, idx, cval->val_type);
+
+ if (val)
+ *val = 0;
+
return filter_error(cval, ret);
}