Skip to content

Commit da2ce0d

Browse files
Nikita Zhandarovichgregkh
authored andcommitted
ASoC: fsl_micfil: Enable default case in micfil_set_quality()
commit a8c9a453387640dbe45761970f41301a6985e7fa upstream. If 'micfil->quality' received from micfil_quality_set() somehow ends up with an unpredictable value, switch() operator will fail to initialize local variable qsel before regmap_update_bits() tries to utilize it. While it is unlikely, play it safe and enable a default case that returns -EINVAL error. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: bea1d61 ("ASoC: fsl_micfil: rework quality setting") Cc: [email protected] Signed-off-by: Nikita Zhandarovich <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 62ab1ae commit da2ce0d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sound/soc/fsl/fsl_micfil.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ static int micfil_set_quality(struct fsl_micfil *micfil)
156156
case QUALITY_VLOW2:
157157
qsel = MICFIL_QSEL_VLOW2_QUALITY;
158158
break;
159+
default:
160+
return -EINVAL;
159161
}
160162

161163
return regmap_update_bits(micfil->regmap, REG_MICFIL_CTRL2,

0 commit comments

Comments
 (0)