diff --git a/sound/soc/codecs/rt5506.c b/sound/soc/codecs/rt5506.c index 74572c4..fbce69a 100644 --- a/sound/soc/codecs/rt5506.c +++ b/sound/soc/codecs/rt5506.c @@ -676,6 +676,8 @@ { if (mode >= rt5506_cfg_data.mode_num) return -EINVAL; + if (rt5506_cfg_data.cmd_data[mode].config.reg_len > MAX_REG_DATA) + return -EINVAL; pr_info("%s: set mode %d\n", __func__, mode);