]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
sun4u: add power_mem_read routine
authorPrasad J Pandit <pjp@fedoraproject.org>
Fri, 4 Jan 2019 09:49:10 +0000 (15:19 +0530)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 30 Jul 2019 20:15:46 +0000 (15:15 -0500)
Define skeleton 'power_mem_read' routine. Avoid NULL dereference.

Reported-by: Fakhri Zulkifli <mohdfakhrizulkifli@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
(cherry picked from commit ad280559c68360c9f1cd7be063857853759e6a73)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/sparc64/sun4u.c

index f76b19e4e93bef001562dffaaf3252fd6ad27fec..5772da02cb13386485da578885c42366a2b62c92 100644 (file)
@@ -214,6 +214,11 @@ typedef struct PowerDevice {
 } PowerDevice;
 
 /* Power */
+static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size)
+{
+    return 0;
+}
+
 static void power_mem_write(void *opaque, hwaddr addr,
                             uint64_t val, unsigned size)
 {
@@ -224,6 +229,7 @@ static void power_mem_write(void *opaque, hwaddr addr,
 }
 
 static const MemoryRegionOps power_mem_ops = {
+    .read = power_mem_read,
     .write = power_mem_write,
     .endianness = DEVICE_NATIVE_ENDIAN,
     .valid = {