From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mx.groups.io with SMTP id smtpd.web08.49512.1606209583107783902 for ; Tue, 24 Nov 2020 01:19:43 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: huawei.com, ip: 45.249.212.191, mailfrom: xiewenyi2@huawei.com) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CgJPG33QCzLsSj; Tue, 24 Nov 2020 17:19:14 +0800 (CST) Received: from [10.174.152.217] (10.174.152.217) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Tue, 24 Nov 2020 17:19:34 +0800 Subject: Re: [PATCH EDK2 v2 1/1] OvmfPkg/XenPvBlkDxe: add return value if allocting fail To: Laszlo Ersek , , , , , CC: References: <1606183592-81879-1-git-send-email-xiewenyi2@huawei.com> <1606183592-81879-2-git-send-email-xiewenyi2@huawei.com> <54dfd7f0-1823-a69d-0814-c62ba613596b@redhat.com> From: "wenyi,xie" Message-ID: <37bc23a3-54cf-c14b-7a57-8d8e7e339239@huawei.com> Date: Tue, 24 Nov 2020 17:19:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.0.1 MIME-Version: 1.0 In-Reply-To: <54dfd7f0-1823-a69d-0814-c62ba613596b@redhat.com> X-Originating-IP: [10.174.152.217] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit It's OK to me. Thanks Wenyi On 2020/11/24 17:16, Laszlo Ersek wrote: > 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 > > . >