From nobody Fri Nov 7 03:41:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1546508465901864.9799284631621; Thu, 3 Jan 2019 01:41:05 -0800 (PST) Received: from localhost ([127.0.0.1]:50152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gezUu-0006fL-In for importer@patchew.org; Thu, 03 Jan 2019 04:41:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gezTG-0005JO-1m for qemu-devel@nongnu.org; Thu, 03 Jan 2019 04:39:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gezTB-00079W-Mv for qemu-devel@nongnu.org; Thu, 03 Jan 2019 04:39:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41760) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gezT7-000754-Qy for qemu-devel@nongnu.org; Thu, 03 Jan 2019 04:39:15 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D6F6FB0837; Thu, 3 Jan 2019 09:39:10 +0000 (UTC) Received: from localhost.localdomain (unknown [10.65.150.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F10455D9CB; Thu, 3 Jan 2019 09:39:07 +0000 (UTC) From: P J P To: QEMU Developers Date: Thu, 3 Jan 2019 15:07:04 +0530 Message-Id: <20190103093704.32635-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 03 Jan 2019 09:39:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] sun4u: add power_mem_read routine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , Fakhri Zulkifli , Artyom Tarasenko , Prasad J Pandit Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Define skeleton 'power_mem_read' routine. Avoid NULL dereference. Reported-by: Fakhri Zulkifli Signed-off-by: Prasad J Pandit --- hw/sparc64/sun4u.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index f76b19e4e9..cbdb2bb411 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -214,6 +214,11 @@ typedef struct PowerDevice { } PowerDevice; =20 /* Power */ +static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0xffffffff; +} + 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, } =20 static const MemoryRegionOps power_mem_ops =3D { + .read =3D power_mem_read, .write =3D power_mem_write, .endianness =3D DEVICE_NATIVE_ENDIAN, .valid =3D { --=20 2.20.1