From: P J P <ppandit@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Fakhri Zulkifli <mohdfakhrizulkifli@gmail.com>,
Artyom Tarasenko <atar4qemu@gmail.com>,
Prasad J Pandit <pjp@fedoraproject.org>
Subject: [Qemu-devel] [PATCH v1] sun4u: add power_mem_read routine
Date: Fri, 4 Jan 2019 15:19:10 +0530 [thread overview]
Message-ID: <20190104094910.5108-1-ppandit@redhat.com> (raw)
From: Prasad J Pandit <pjp@fedoraproject.org>
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>
---
hw/sparc64/sun4u.c | 6 ++++++
1 file changed, 6 insertions(+)
Update v1: change return value to zero(0)
-> https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg00448.html
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index f76b19e4e9..5772da02cb 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -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 = {
--
2.20.1
reply other threads:[~2019-01-04 9:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190104094910.5108-1-ppandit@redhat.com \
--to=ppandit@redhat.com \
--cc=atar4qemu@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mohdfakhrizulkifli@gmail.com \
--cc=pjp@fedoraproject.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).