From 2207367bddb37679efd2e71cd285ffb99a57c0bb Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 30 Aug 2024 23:20:22 +0200 Subject: [PATCH] Fixed the segmentation fault on mouse movement when the serial mouse is attached to a disabled serial port. --- src/device/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device/serial.c b/src/device/serial.c index ecc08f15d..2b832f750 100644 --- a/src/device/serial.c +++ b/src/device/serial.c @@ -223,7 +223,7 @@ serial_write_fifo(serial_t *dev, uint8_t dat) ((dev->type >= SERIAL_16550) && dev->fifo_enabled) ? fifo_get_count(dev->rcvr_fifo) : 0); - if (!(dev->mctrl & 0x10)) + if ((dev != NULL) && !(dev->mctrl & 0x10)) write_fifo(dev, dat); }