ASoC: Intel: avs: Do not reuse msg between different IPC handlers
authorCezary Rojewski <cezary.rojewski@intel.com>
Mon, 10 Oct 2022 12:19:50 +0000 (14:19 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 17 Oct 2022 11:50:13 +0000 (12:50 +0100)
While LOG_BUFFER_STATUS is a simple notification with only one
meaningful field, same message ptr shall not be reused for two different
handlers.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221010121955.718168-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/apl.c

index b8e2b23c9f6423798d688506fa891f822e7e0956..7c8ce98eda9dd2fa386babea540ff0b8cc7cd8e8 100644 (file)
@@ -133,12 +133,14 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
        buf = apl_log_payload_addr(addr);
        memcpy_fromio(&layout, addr, sizeof(layout));
        if (!apl_is_entry_stackdump(buf + layout.read_ptr)) {
+               union avs_notify_msg lbs_msg = AVS_NOTIFICATION(LOG_BUFFER_STATUS);
+
                /*
                 * DSP awaits the remaining logs to be
                 * gathered before dumping stack
                 */
-               msg->log.core = msg->ext.coredump.core_id;
-               avs_dsp_op(adev, log_buffer_status, msg);
+               lbs_msg.log.core = msg->ext.coredump.core_id;
+               avs_dsp_op(adev, log_buffer_status, &lbs_msg);
        }
 
        pos = dump + AVS_FW_REGS_SIZE;