From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web11.49963.1606209405661095852 for ; Tue, 24 Nov 2020 01:16:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gaSkFjWN; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606209404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PPD7ygjfl9GlVbq/n/W+uMUQiHpOocVfprNFH1KFzUc=; b=gaSkFjWNoLZSOmdsOOuLIuyraRFTcodWMpO/NKt67w5jf451DB/Og1KkpkgMuJM8DoYGB8 Syl8bDjifqWEcpTsCVwoemcor/XAc2/AuvdSebFpnB30i3Arp/HjZ1ZsKr+LT4qGrwkRlh 3sIIAfeG14dDsD/8kLp83h23oFFU57Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-364-7BehgpiZMAqfMdtc8gh9bg-1; Tue, 24 Nov 2020 04:16:40 -0500 X-MC-Unique: 7BehgpiZMAqfMdtc8gh9bg-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id C0D498030BE; Tue, 24 Nov 2020 09:16:38 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-113.ams2.redhat.com [10.36.113.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC6745D9CC; Tue, 24 Nov 2020 09:16:36 +0000 (UTC) Subject: Re: [PATCH EDK2 v2 1/1] OvmfPkg/XenPvBlkDxe: add return value if allocting fail To: Wenyi Xie , devel@edk2.groups.io, jordan.l.justen@intel.com, ard.biesheuvel@arm.com, anthony.perard@citrix.com, julien@xen.org Cc: songdongkuang@huawei.com References: <1606183592-81879-1-git-send-email-xiewenyi2@huawei.com> <1606183592-81879-2-git-send-email-xiewenyi2@huawei.com> From: "Laszlo Ersek" Message-ID: <54dfd7f0-1823-a69d-0814-c62ba613596b@redhat.com> Date: Tue, 24 Nov 2020 10:16:34 +0100 MIME-Version: 1.0 In-Reply-To: <1606183592-81879-2-git-send-email-xiewenyi2@huawei.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/24/20 03:06, Wenyi Xie wrote: > return EFI_OUT_OF_RESOURCES if pool allocating fail. > > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Anthony Perard > Cc: Julien Grall > Signed-off-by: Wenyi Xie > --- > OvmfPkg/XenPvBlkDxe/BlockFront.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/OvmfPkg/XenPvBlkDxe/BlockFront.c b/OvmfPkg/XenPvBlkDxe/BlockFront.c > index 122a6baed25a..32d70c36cef2 100644 > --- a/OvmfPkg/XenPvBlkDxe/BlockFront.c > +++ b/OvmfPkg/XenPvBlkDxe/BlockFront.c > @@ -155,6 +155,10 @@ XenPvBlockFrontInitialization ( > ASSERT (NodeName != NULL); > > Dev = AllocateZeroPool (sizeof (XEN_BLOCK_FRONT_DEVICE)); > + if (Dev == NULL) { > + return EFI_OUT_OF_RESOURCES; > + } > + > Dev->Signature = XEN_BLOCK_FRONT_SIGNATURE; > Dev->NodeName = NodeName; > Dev->XenBusIo = XenBusIo; > Reviewed-by: Laszlo Ersek Unless it's urgent for you, I'd like to merge this after edk2-stable202011. It's a bugfix alright, but the issue seems to have existed for a long time, with presumably no symptoms for most users. Thanks Laszlo