probe: don't store pointers to configuration data

probe configuration data, passed to probe_point_add() cannot be used
outside of the scope of the function, therefore storing pointers to
it for later use is invalid. The pointer is only used in the
notification handler to extract the buffer ID. Use the ID from the
probes' persistent data instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2022-10-13 14:57:10 +02:00 committed by Liam Girdwood
parent ab3ad0151a
commit 6f38baa1a0
1 changed files with 6 additions and 4 deletions

View File

@ -1189,15 +1189,17 @@ int probe_point_add(uint32_t count, struct probe_point *probe)
return -EINVAL;
#endif
} else {
probe_point_id_t *new_buf_id = &_probe->probe_points[first_free].buffer_id;
#if CONFIG_IPC_MAJOR_4
notifier_register(&probe[i].buffer_id.full_id, buf, NOTIFIER_ID_BUFFER_PRODUCE,
notifier_register(&new_buf_id->full_id, buf, NOTIFIER_ID_BUFFER_PRODUCE,
&probe_cb_produce, 0);
notifier_register(&probe[i].buffer_id.full_id, buf, NOTIFIER_ID_BUFFER_FREE,
notifier_register(&new_buf_id->full_id, buf, NOTIFIER_ID_BUFFER_FREE,
&probe_cb_free, 0);
#else
notifier_register(&probe[i].buffer_id.full_id, dev->cb, NOTIFIER_ID_BUFFER_PRODUCE,
notifier_register(&new_buf_id->full_id, dev->cb, NOTIFIER_ID_BUFFER_PRODUCE,
&probe_cb_produce, 0);
notifier_register(&probe[i].buffer_id.full_id, dev->cb, NOTIFIER_ID_BUFFER_FREE,
notifier_register(&new_buf_id->full_id, dev->cb, NOTIFIER_ID_BUFFER_FREE,
&probe_cb_free, 0);
#endif
}