ASoC: dsp: amrwb_in: Fix AUDIO_GET_AMRWB_ENC_CONFIG ioctl

The non-blocking if-statement here causes the AUDIO_GET_AMRWB_ENC_CONFIG
ioctl to always return -EFAULT, even upon success. Fix it by correctly
guarding the -EFAULT return value.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
Sultan Alsawaf 2021-07-10 16:57:36 -07:00 committed by Adithya R
parent 8c056fed40
commit 1ca541a2d4

View File

@ -160,10 +160,11 @@ static long amrwb_in_ioctl(struct file *file,
}
case AUDIO_GET_AMRWB_ENC_CONFIG: {
if (copy_to_user((void *)arg, audio->enc_cfg,
sizeof(struct msm_audio_amrwb_enc_config)))
sizeof(struct msm_audio_amrwb_enc_config))) {
pr_err("%s: copy_to_user for AUDIO_GET_AMRWB_ENC_CONFIG failed\n",
__func__);
rc = -EFAULT;
}
break;
}
case AUDIO_SET_AMRWB_ENC_CONFIG: {