Commit 3da4b740 authored by Tom Rix's avatar Tom Rix Committed by Takashi Iwai

ALSA: usb-audio: initialize variables that could ignore errors

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: 48cc4297 ("ALSA: usb-audio: Filter error from connector kctl ops, too")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20220126182142.1184819-1-trix@redhat.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 549f8ffc
...@@ -1527,6 +1527,10 @@ static int get_connector_value(struct usb_mixer_elem_info *cval, ...@@ -1527,6 +1527,10 @@ static int get_connector_value(struct usb_mixer_elem_info *cval,
usb_audio_err(chip, usb_audio_err(chip,
"cannot get connectors status: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", "cannot get connectors status: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",
UAC_GET_CUR, validx, idx, cval->val_type); UAC_GET_CUR, validx, idx, cval->val_type);
if (val)
*val = 0;
return filter_error(cval, ret); return filter_error(cval, ret);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment