From nobody Mon Feb 9 16:19:12 2026 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 15446434939274.6484199240507; Wed, 12 Dec 2018 11:38:13 -0800 (PST) Received: from localhost ([::1]:47642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXAKi-0003iA-V0 for importer@patchew.org; Wed, 12 Dec 2018 14:38:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXAFY-0008Ay-3K for qemu-devel@nongnu.org; Wed, 12 Dec 2018 14:32:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXAFX-0001S0-Au for qemu-devel@nongnu.org; Wed, 12 Dec 2018 14:32:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44380) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXAFX-0001RX-4P for qemu-devel@nongnu.org; Wed, 12 Dec 2018 14:32:51 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FD83A404B; Wed, 12 Dec 2018 19:32:50 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-138.sin2.redhat.com [10.67.116.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08F13600CC; Wed, 12 Dec 2018 19:32:47 +0000 (UTC) From: P J P To: Yuval Shaia Date: Thu, 13 Dec 2018 01:00:35 +0530 Message-Id: <20181212193039.11445-3-ppandit@redhat.com> In-Reply-To: <20181212193039.11445-1-ppandit@redhat.com> References: <20181212193039.11445-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 12 Dec 2018 19:32:50 +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 v2 2/6] pvrdma: add uar_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: Prasad J Pandit , Li Qiang , Qemu Developers , Saar Amar 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 'uar_read' routine. Avoid NULL dereference. Reported-by: Li Qiang Signed-off-by: Prasad J Pandit Reviewed-by: Marcel Apfelbaum --- hw/rdma/vmw/pvrdma_main.c | 6 ++++++ 1 file changed, 6 insertions(+) Update: change return value from uar_read() -> https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg02787.html diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 23dc9926e3..997d7f395a 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -448,6 +448,11 @@ static const MemoryRegionOps regs_ops =3D { }, }; =20 +static uint64_t uar_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0xffffffff; +} + static void uar_write(void *opaque, hwaddr addr, uint64_t val, unsigned si= ze) { PVRDMADev *dev =3D opaque; @@ -489,6 +494,7 @@ static void uar_write(void *opaque, hwaddr addr, uint64= _t val, unsigned size) } =20 static const MemoryRegionOps uar_ops =3D { + .read =3D uar_read, .write =3D uar_write, .endianness =3D DEVICE_LITTLE_ENDIAN, .impl =3D { --=20 2.19.2