linux/sound/usb
Nathan Chancellor 3a56855bb5 ALSA: scarlett2: Zero initialize ret in scarlett2_ag_target_ctl_get()
Clang warns (or errors with CONFIG_WERROR):

  sound/usb/mixer_scarlett2.c:3697:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
   3697 |         if (private->autogain_updated) {
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~
  sound/usb/mixer_scarlett2.c:3707:9: note: uninitialized use occurs here
   3707 |         return err;
        |                ^~~
  sound/usb/mixer_scarlett2.c:3697:2: note: remove the 'if' if its condition is always true
   3697 |         if (private->autogain_updated) {
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sound/usb/mixer_scarlett2.c:3688:9: note: initialize the variable 'err' to silence this warning
   3688 |         int err;
        |                ^
        |                 = 0
  1 error generated.

Initialize ret to zero to ensure ret is initialized in all paths within
scarlett2_ag_target_ctl_get(), which matches the style of other
functions in this driver.

Fixes: e30ea5340c ("ALSA: scarlett2: Add autogain target controls")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Message-ID: <20240419-alsa-scarlett2-fix-wsometimes-uninitialized-v1-1-e2ace8642e08@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-04-21 19:30:53 +02:00
..
6fire ALSA: usb/6fire: fix repeated words in comments 2022-07-25 08:28:17 +02:00
bcd2000 ALSA: bcd2000: refactor deprecated strncpy 2023-07-29 13:53:56 +02:00
caiaq ALSA: caiaq: Replace with __packed attribute 2023-10-26 09:43:07 +02:00
hiface ALSA: hiface: fix repeated words in comments 2022-07-25 08:28:37 +02:00
line6 ALSA: line6: Zero-initialize message buffers 2024-04-02 15:01:27 +02:00
misc ALSA: ua101: fix division by zero at probe 2021-10-27 08:23:30 +02:00
usx2y ALSA: usx2y: Annotate struct snd_usx2y_urb_seq with __counted_by 2023-09-23 12:36:59 +02:00
card.c ALSA: usb-audio: USB MIDI 2.0 UMP support 2023-05-23 12:11:02 +02:00
card.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2022-12-22 09:13:54 +01:00
clock.c ALSA: usb-audio: Ignore clock selector errors for single connection 2024-02-01 15:29:40 +01:00
clock.h ALSA: usb-audio: Constify audioformat pointer references 2020-11-23 15:15:36 +01:00
endpoint.c ALSA: usb-audio: Don't try to submit URBs after disconnection 2023-08-28 15:03:35 +02:00
endpoint.h ALSA: usb-audio: Remove unused function declaration 2023-08-01 16:56:57 +02:00
format.c ALSA: usb-audio: Check presence of valid altsetting control 2024-01-29 16:46:01 +01:00
format.h
helper.c ALSA: usb-audio: remove Wireless USB dead code 2023-03-14 17:00:57 +01:00
helper.h ALSA: usb-audio: Add snd_usb_get_host_interface() helper 2020-11-23 15:13:47 +01:00
implicit.c ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format() 2023-01-09 16:05:21 +01:00
implicit.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2022-12-22 09:13:54 +01:00
Kconfig ALSA: usb-audio: USB MIDI 2.0 UMP support 2023-05-23 12:11:02 +02:00
Makefile ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 2023-10-27 11:22:59 +02:00
media.c ALSA: pcm: Don't embed device 2023-08-17 09:23:45 +02:00
media.h
midi.c ALSA: usb-audio: More relaxed check of MIDI jack names 2024-02-15 16:56:05 +01:00
midi.h ALSA: usb-audio: Manage number of rawmidis globally 2023-05-23 12:11:00 +02:00
midi2.c ALSA: usb-audio: fix typo 2024-01-24 14:40:47 +01:00
midi2.h ALSA: usb-audio: USB MIDI 2.0 UMP support 2023-05-23 12:11:02 +02:00
mixer.c Revert "ALSA: usb-audio: Name feature ctl using output if input is PCM" 2024-03-17 09:32:49 +01:00
mixer.h ALSA: usb-audio: Drop CONFIG_PM ifdefs 2021-12-06 10:19:40 +01:00
mixer_maps.c ALSA: usb-audio: Add quirk for Microsoft Modern Wireless Headset 2023-07-25 14:21:11 +02:00
mixer_quirks.c ALSA: scarlett2: Add support for Focusrite Vocaster One and Two 2024-04-18 08:31:14 +02:00
mixer_quirks.h ALSA: usb-audio: Drop CONFIG_PM ifdefs 2021-12-06 10:19:40 +01:00
mixer_s1810c.c ALSA: usb-audio: remove redundant assignment to variable c 2022-02-08 08:21:32 +01:00
mixer_s1810c.h
mixer_scarlett.c ALSA: usb-audio: fix spelling mistakes 2021-07-05 19:33:54 +02:00
mixer_scarlett.h
mixer_scarlett2.c ALSA: scarlett2: Zero initialize ret in scarlett2_ag_target_ctl_get() 2024-04-21 19:30:53 +02:00
mixer_scarlett2.h ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 2023-10-27 11:22:59 +02:00
mixer_us16x08.c ALSA: usb-audio: US16x08: Move overflow check before array access 2022-06-13 07:40:08 +02:00
mixer_us16x08.h
pcm.c ALSA: usb-audio: Fix broken resume due to UAC3 power state 2023-06-16 09:28:08 +02:00
pcm.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2022-12-22 09:13:54 +01:00
power.c
power.h ALSA: usb-audio: Drop CONFIG_PM ifdefs 2021-12-06 10:19:40 +01:00
proc.c ALSA: usb-audio: Show sync endpoint information in proc outputs 2020-11-23 15:16:45 +01:00
proc.h
quirks-table.h ALSA: usb-audio: Add support for Mythware XA001AU capture and playback interfaces. 2023-08-04 12:47:30 +02:00
quirks.c ALSA: usb-audio: Sort quirk table entries 2024-01-24 16:57:11 +01:00
quirks.h ALSA: usb-audio: Register card at the last interface 2022-09-06 11:04:56 +02:00
stream.c ALSA: usb-audio: Stop parsing channels bits when all channels are found. 2024-03-13 14:29:22 +01:00
stream.h
usbaudio.h ALSA: usb-audio: USB MIDI 2.0 UMP support 2023-05-23 12:11:02 +02:00
validate.c