bcm2835_audio_callback: Don't process garbage if there is no message.

If vchi_msg_dequeue failed due to an empty queue, return rather than
treating stack garbage as a valid message.
This commit is contained in:
John Baldwin 2022-04-08 18:31:29 -07:00
parent 4b9b6a501a
commit 4f6be8c788

View File

@ -207,6 +207,8 @@ bcm2835_audio_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *m
status = vchi_msg_dequeue(sc->vchi_handle,
&m, sizeof m, &msg_len, VCHI_FLAGS_NONE);
if (status != 0)
return;
if (m.type == VC_AUDIO_MSG_TYPE_RESULT) {
if (m.u.result.success) {
device_printf(sc->dev,