diff --git a/asoc/codecs/wcdcal-hwdep.c b/asoc/codecs/wcdcal-hwdep.c index 7e2b984a9304..a0455fdd104b 100644 --- a/asoc/codecs/wcdcal-hwdep.c +++ b/asoc/codecs/wcdcal-hwdep.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015, 2017-2018, 2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. * */ #include @@ -60,17 +61,17 @@ static int wcdcal_hwdep_ioctl_shared(struct snd_hwdep *hw, struct firmware_cal **fw = fw_data->fw; void *data; - if (!test_bit(fw_user.cal_type, fw_data->cal_bit)) { - pr_err("%s: codec didn't set this %d!!\n", - __func__, fw_user.cal_type); - return -EFAULT; - } if (fw_user.cal_type >= WCD9XXX_MAX_CAL || fw_user.cal_type < WCD9XXX_MIN_CAL) { pr_err("%s: wrong cal type sent %d\n", __func__, fw_user.cal_type); return -EFAULT; } + if (!test_bit(fw_user.cal_type, fw_data->cal_bit)) { + pr_err("%s: codec didn't set this %d!!\n", + __func__, fw_user.cal_type); + return -EFAULT; + } if (fw_user.size > cal_size_info[fw_user.cal_type] || fw_user.size <= 0) { pr_err("%s: incorrect firmware size %d for %s\n", diff --git a/dsp/q6afecal-hwdep.c b/dsp/q6afecal-hwdep.c index ef194ff6ac39..401de1e93b19 100644 --- a/dsp/q6afecal-hwdep.c +++ b/dsp/q6afecal-hwdep.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015, 2017 - 2018, 2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. */ #include #include @@ -61,17 +62,17 @@ static int q6afecal_hwdep_ioctl_shared(struct snd_hwdep *hw, struct firmware_cal **fw = fw_data->fw; void *data; - if (!test_bit(fw_user.cal_type, fw_data->cal_bit)) { - pr_err("%s: q6afe didn't set this %d!!\n", - __func__, fw_user.cal_type); - return -EFAULT; - } if (fw_user.cal_type >= Q6AFE_MAX_CAL || fw_user.cal_type < Q6AFE_MIN_CAL) { pr_err("%s: wrong cal type sent %d\n", __func__, fw_user.cal_type); return -EFAULT; } + if (!test_bit(fw_user.cal_type, fw_data->cal_bit)) { + pr_err("%s: q6afe didn't set this %d!!\n", + __func__, fw_user.cal_type); + return -EFAULT; + } if (fw_user.size > cal_size_info[fw_user.cal_type] || fw_user.size <= 0) { pr_err("%s: incorrect firmware size %d for %s\n",