ALSA: scarlett2: Add missing error check when initialise Autogain Status
Subsystems (2)
PATCH 1/1 ALSA: scarlett2: Add missing error check when initialise Autogain Status
When initialise new control with scarlett2_add_new_ctl() function for Autogain Status, scarlett2_add_new_ctl() might throw an error. So, add error check after initialise new control for Autogain Status.
This is reported by Coverity Scan with CID 1598781 as UNUSED_VALUE.
---
I don't have the device myself, so I can't test this change. Thank you.
sound/usb/mixer_scarlett2.c | 2 ++ 1 file changed, 2 insertions(+)
sound/usb/mixer_scarlett2.c +2 -0
@@ -6707,6 +6707,8 @@ static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer) err =scarlett2_add_new_ctl ( mixer, &scarlett2_autogain_status_ctl, i,1 , s, &private->autogain_status_ctls[i]); +if (err <0 ) +return err; }/* Add autogain target controls */
base-commit: 7fd2df204f342fc17d1a0bfcd474b24232fb0f32
Signature · 1 line
2.54.0
Quoted 9 lines · Robertus Diawan Chris
When initialise new control with
scarlett2_add_new_ctl()function for Autogain Status,scarlett2_add_new_ctl()might throw an error. So, add error check after initialise new control for Autogain Status.This is reported by Coverity Scan with CID 1598781 as
UNUSED_VALUE.Fixes 0a995e38dc44 ("ALSA: scarlett2: Add support for software-controllable input gain")Signed-off-by Robertus Diawan Chris <[email protected]>
Applied now. Thanks.
Takashi