mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-30 01:46:30 -05:00
42 lines
1.5 KiB
Diff
42 lines
1.5 KiB
Diff
|
From 43ff88a8336310e665941dea6ffec77cc8314706 Mon Sep 17 00:00:00 2001
|
||
|
From: kunleiz <kunleiz@codeaurora.org>
|
||
|
Date: Fri, 14 Apr 2017 10:28:42 +0800
|
||
|
Subject: [PATCH] ASoC: msm: qdspv2: add result check when audio process fail
|
||
|
|
||
|
A audio_process_event_req is not always to success. Therefore,
|
||
|
check the return value for audio_process_event_req, and
|
||
|
initializ usr_evt before using it.
|
||
|
|
||
|
CRs-Fixed: 2029798
|
||
|
Bug: 35764875
|
||
|
Change-Id: I4adf682575f5f9233a1a1a533f9c6361af8a5bcf
|
||
|
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
|
||
|
---
|
||
|
drivers/misc/qcom/qdsp6v2/audio_utils_aio.c | 6 ++++++
|
||
|
1 file changed, 6 insertions(+)
|
||
|
|
||
|
diff --git a/drivers/misc/qcom/qdsp6v2/audio_utils_aio.c b/drivers/misc/qcom/qdsp6v2/audio_utils_aio.c
|
||
|
index ea1cb510a97fa..59f40806ee2be 100644
|
||
|
--- a/drivers/misc/qcom/qdsp6v2/audio_utils_aio.c
|
||
|
+++ b/drivers/misc/qcom/qdsp6v2/audio_utils_aio.c
|
||
|
@@ -842,6 +842,7 @@ static long audio_aio_process_event_req_compat(struct q6audio_aio *audio,
|
||
|
long rc;
|
||
|
struct msm_audio_event32 usr_evt_32;
|
||
|
struct msm_audio_event usr_evt;
|
||
|
+ memset(&usr_evt, 0, sizeof(struct msm_audio_event));
|
||
|
|
||
|
if (copy_from_user(&usr_evt_32, arg,
|
||
|
sizeof(struct msm_audio_event32))) {
|
||
|
@@ -851,6 +852,11 @@ static long audio_aio_process_event_req_compat(struct q6audio_aio *audio,
|
||
|
usr_evt.timeout_ms = usr_evt_32.timeout_ms;
|
||
|
|
||
|
rc = audio_aio_process_event_req_common(audio, &usr_evt);
|
||
|
+ if (rc < 0) {
|
||
|
+ pr_err("%s: audio process event failed, rc = %ld",
|
||
|
+ __func__, rc);
|
||
|
+ return rc;
|
||
|
+ }
|
||
|
|
||
|
usr_evt_32.event_type = usr_evt.event_type;
|
||
|
switch (usr_evt_32.event_type) {
|