mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
audio: add param check for resample [1/1]
PD#SWPL-7798 Problem: Crashed when audio resample setting params are invalid. Solution: Add check method if the params is invalid. Verify: Tl1. Change-Id: I1e0396be8d401c0a49ff0de9fd7f160f0c8133ca Signed-off-by: Shuai Li <shuai.li@amlogic.com>
This commit is contained in:
@@ -1600,6 +1600,12 @@ static int aml_spdif_parse_of(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
p_spdif->auto_asrc = 0;
|
||||
|
||||
if (p_spdif->auto_asrc < RATE_OFF ||
|
||||
p_spdif->auto_asrc > RATE_192K) {
|
||||
pr_info("%s(), inval asrc setting %d\n",
|
||||
__func__, p_spdif->auto_asrc);
|
||||
p_spdif->auto_asrc = RATE_OFF;
|
||||
}
|
||||
pr_debug("SPDIF id %d asrc_id:%d auto_asrc:%d\n",
|
||||
p_spdif->id,
|
||||
p_spdif->asrc_id,
|
||||
|
||||
Reference in New Issue
Block a user