Skip to content

Commit a1ed2ec

Browse files
committed
ALSA: usb-audio: Fix missing error handling for get_min_max*()
The recent fix to add the error return value check from get_min_max*() missed one case in build_audio_procunit() where no error value is set. This may lead to an uninitialized variable and confuse the caller (although this wouldn't happen practically because err is set for the loop of num_ins at the beginning of the funciton). Fix it by setting "err = 0" properly at the missing case, too. Fixes: 4f55a85 ("ALSA: usb-audio: Add error checks against get_min_max*()") Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/[email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 46c862f commit a1ed2ec

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

sound/usb/mixer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,6 +2687,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
26872687
cval->max = control_spec[0];
26882688
cval->res = 1;
26892689
cval->initialized = 1;
2690+
err = 0;
26902691
break;
26912692
}
26922693

0 commit comments

Comments
 (0)