qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/display/xlnx_dp: fix overflow in xlnx_dp_aux_push_tx_fifo()
@ 2023-01-09  5:59 Qiang Liu
  2023-01-09 22:58 ` Alistair Francis
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Qiang Liu @ 2023-01-09  5:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Qiang Liu, Alistair Francis, Edgar E. Iglesias, Peter Maydell,
	open list:Xilinx ZynqMP and...

This patch checks if the s->tx_fifo is full.

Fixes: 58ac482a66de ("introduce xlnx-dp")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1424
Reported-by: Qiang Liu <cyruscyliu@gmail.com>
Signed-off-by: Qiang Liu <cyruscyliu@gmail.com>
---
 hw/display/xlnx_dp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
index 972473d94f..617b394af2 100644
--- a/hw/display/xlnx_dp.c
+++ b/hw/display/xlnx_dp.c
@@ -854,7 +854,11 @@ static void xlnx_dp_write(void *opaque, hwaddr offset, uint64_t value,
         break;
     case DP_AUX_WRITE_FIFO: {
         uint8_t c = value;
-        xlnx_dp_aux_push_tx_fifo(s, &c, 1);
+        if (fifo8_is_full(&s->tx_fifo)) {
+            qemu_log_mask(LOG_GUEST_ERROR, "xlnx_dp: TX fifo is full");
+        } else {
+            xlnx_dp_aux_push_tx_fifo(s, &c, 1);
+        }
         break;
     }
     case DP_AUX_CLOCK_DIVIDER:
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-11  2:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-09  5:59 [PATCH] hw/display/xlnx_dp: fix overflow in xlnx_dp_aux_push_tx_fifo() Qiang Liu
2023-01-09 22:58 ` Alistair Francis
2023-01-10 12:02 ` Edgar E. Iglesias
2023-01-10 13:57 ` Konrad, Frederic
2023-01-11  2:01   ` Qiang Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).