]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: initialize variables that could ignore errors
authorTom Rix <trix@redhat.com>
Wed, 26 Jan 2022 18:21:42 +0000 (10:21 -0800)
committerTakashi Iwai <tiwai@suse.de>
Thu, 27 Jan 2022 13:41:16 +0000 (14:41 +0100)
commit7a0925e8c0742b1b9cbfeda52325709c20cd3073
treed12b7049dedf9cb82c8664ebae646da8f05d3c3d
parent4543ca7f65796ab42fe4adfc72d99b0ba289e865
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: 287526f6a10a ("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>
sound/usb/mixer.c