From baed114a16b44f17708e8ff991d8a486429f82bc Mon Sep 17 00:00:00 2001 From: Poomarin Phloyphisut Date: Fri, 9 Jun 2023 13:04:59 +0000 Subject: amcs: Fix bug on wrong index lookup in Bt data. Test: local test Bug: 280248992 Change-Id: I983a24947c1fb01bd8b7add08bbadee65dc488eb --- audiometrics/audiometrics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audiometrics/audiometrics.c b/audiometrics/audiometrics.c index b0a9051..8c8a833 100644 --- a/audiometrics/audiometrics.c +++ b/audiometrics/audiometrics.c @@ -1071,12 +1071,12 @@ static long amcs_cdev_unlocked_ioctl(struct file *file, unsigned int cmd, unsign case AMCS_OP_BT_ACTIVE_DURATION_INCREASE: ret = 0; - codec = params.val[1]; + codec = params.val[0]; if (codec >= CODEC_MAX_COUNT) { ret = -EINVAL; } else { mutex_lock(&priv->lock); - priv->sz.bt_active_duration[codec] += params.val[2]; + priv->sz.bt_active_duration[codec] += params.val[1]; mutex_unlock(&priv->lock); } break; -- cgit v1.2.3