mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
ALSA: usb-audio: initialize variables that could ignore errors
commit3da4b7403d
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:48cc429735
("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>
This commit is contained in:
parent
63c69c93d9
commit
c2a91f1ef3
1 changed files with 4 additions and 0 deletions
|
@ -1496,6 +1496,10 @@ static int get_connector_value(struct usb_mixer_elem_info *cval,
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue