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. Change-Id: Ia3a7247f5febb21d3b654c0ed29e81135e732c79 Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> [dereference23: Extend to audio-kernel 4.0] Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
This commit is contained in:
parent
25afda004f
commit
20a093deea
@ -152,10 +152,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: {
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user