Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2022 17:58:49 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: fabc2ac3add8 - stable/13 - bcm2835_audio_callback: Don't process garbage if there is no message.
Message-ID:  <202205131758.24DHwnAo069568@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=fabc2ac3add8f505e29483f40127813edfcb141a

commit fabc2ac3add8f505e29483f40127813edfcb141a
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-09 01:31:29 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-05-13 17:44:43 +0000

    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.
    
    (cherry picked from commit 4f6be8c788ca0339a84e935515d290b59dbec31b)
---
 sys/arm/broadcom/bcm2835/bcm2835_audio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/arm/broadcom/bcm2835/bcm2835_audio.c b/sys/arm/broadcom/bcm2835/bcm2835_audio.c
index ae2c9a14fc62..da5939ec33cb 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_audio.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_audio.c
@@ -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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202205131758.24DHwnAo069568>