From f47fcf26ee909895626a9ecebcdd929bfec5d731 Mon Sep 17 00:00:00 2001 From: Deepali Jindal Date: Mon, 16 Oct 2023 21:26:37 +0530 Subject: [PATCH] asoc: msm_common: Update in aud_dev_sysfs_store to fix out of bound error Update change to have proper input validation of pcm_id in aud_dev_sysfs_store to avoid out of bound issue. Change-Id: Ia95a8dff8db84d95b4b02a5674f64a85f67e4be0 Signed-off-by: Deepali Jindal --- asoc/msm_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asoc/msm_common.c b/asoc/msm_common.c index d39846772d..7107e44e87 100644 --- a/asoc/msm_common.c +++ b/asoc/msm_common.c @@ -117,7 +117,7 @@ static ssize_t aud_dev_sysfs_store(struct kobject *kobj, sscanf(buf, "%d %d", &pcm_id, &state); - if ((pcm_id > pdata->num_aud_devs) || (pcm_id < 0)) { + if ((pcm_id >= pdata->num_aud_devs) || (pcm_id < 0)) { pr_err("%s: invalid pcm id %d \n", __func__, pcm_id); goto done; }