Skip to contentSkip to conversation

hw/display/xlnx_dp: fix abort in xlnx_dp_change_graphic_fmt()

PATCH New Qiang Liu 1 participant 1 message Jan 16, 2023

lore
Share & tools
lore

Qiang Liu

author
#0 lore raw

PATCH 1/1 hw/display/xlnx_dp: fix abort in xlnx_dp_change_graphic_fmt()

xlnx_dp_change_graphic_fmt() will directly abort if either graphic format or the video format is not supported.

This patch directly let xlnx_dp_change_graphic_fmt() return if the formats are not supported.

xlnx_dp_change_graphic_fmt() has two callsites in xlnx_dp_avbufm_write() and xlnx_dp_reset(). I think it may be OK to drop the abort in xlnx_dp_change_graphic_fmt() because the error information will be printed.

Fixes 58ac482a66de ("introduce xlnx-dp")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1415

---
 hw/display/xlnx_dp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/display/xlnx_dp.c +2 -2
index b0828d65aa..407518c870 100644
@@ -641,7 +641,7 @@ static void xlnx_dp_change_graphic_fmt(XlnxDPState *s)
     default:
         error_report("%s: unsupported graphic format %u", __func__,
                      s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK);
-        abort();
+        return;
     }
 
     switch (s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MASK) {
@@ -657,7 +657,7 @@ static void xlnx_dp_change_graphic_fmt(XlnxDPState *s)
     default:
         error_report("%s: unsupported video format %u", __func__,
                      s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MASK);
-        abort();
+        return;
     }
 
     xlnx_dp_recreate_surface(s);
Signature · 1 line
2.25.1