From 968be0ae5b8563e3441ce3977a40a9049ba8309a Mon Sep 17 00:00:00 2001 From: Vidyakumar Athota Date: Thu, 12 Jul 2018 16:39:44 -0700 Subject: [PATCH] dsp: q6afe: fix payload copy issue in module event Payload is copied incorrectly in AFE module event callback. Fix this issue with proper typecast of payload pointer. Change-Id: I58642a054667912bcc01ae19c8c73d28c28b5589 Signed-off-by: Vidyakumar Athota --- dsp/q6afe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dsp/q6afe.c b/dsp/q6afe.c index 405c24faa75b..03fbdb76dc19 100644 --- a/dsp/q6afe.c +++ b/dsp/q6afe.c @@ -337,6 +337,7 @@ static int32_t sp_make_afe_callback(uint32_t opcode, uint32_t *payload, static void afe_notify_dc_presence(void) { + pr_debug("%s: DC detected\n", __func__); msm_aud_evt_notifier_call_chain(MSM_AUD_DC_EVENT, NULL); schedule_work(&this_afe.afe_dc_work); @@ -542,7 +543,7 @@ static int32_t afe_callback(struct apr_client_data *data, void *priv) (evt_pl->payload_size == sizeof(flag_dc_presence))) { memcpy(&flag_dc_presence, - payload + + (uint8_t *)payload + sizeof(struct afe_port_mod_evt_rsp_hdr), evt_pl->payload_size); if (flag_dc_presence[0] == 1 ||