From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::342; helo=mail-wm1-x342.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C2C8921B02822 for ; Tue, 19 Mar 2019 06:46:57 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id a188so16505235wmf.3 for ; Tue, 19 Mar 2019 06:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TGbZUHjn4WWGY4Qd9KN8OEc7cRs1ZkyUi6gCK19Ttkc=; b=xTFdh+/4gKDOU8OHtvDSeRqzBdJRJvSlxUBy4mF8NXaAMFSddE838rTgx9ymLEl1B9 hKynPlYZhXowvBgL2c/xzXXu+UiPO77hwbNhcoglfJyZBNx0kp4X4YL19jCDVBxOogYj JFkcrgUL+Ne2bo9mLMYNdJtaQQGoPxDZLYskHW0p0rxhSoKVQJpVpHyYbJwJyuQuJ77v StDLMP8D+blgxbIXT0Y2NnrsqlK7iZSOzAgiY7TLH/cW6wJQrH6ngvliWtTSZ7xrBPTc nlUKQvGOQRoJhn4Q2yh06ylZjJdHobZ7fi4lFOE6pQ+88JOg4RNJLXPqZK/3YzWV/rYA 9gZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TGbZUHjn4WWGY4Qd9KN8OEc7cRs1ZkyUi6gCK19Ttkc=; b=qmQBS+ryuDQkrjbQ/ExvpiSYZ2b7QGmloHIl5t7iTSq3+lGBGozJIhipTeM3sIoTYS SsG78/LZN76OZgWYhVQT5hiYl9HPJwhG93SmlV7Qzo+OYYwSBl6GKYST/+b5QTX72K0F 1eF9o7u6FHYrZ4T8+m9/cwczVQZTZ/496kpz/k/PsHO66p4wKUZ4uL7+z8ryXPf1Ofm0 21OqwmfKcWooB3gyndlnmaQPGeQfaVLdo+L03FvDvx+jH7yLvANTwU0aNozOpNNicrkk +vwrG46zOZhwYlawA0D4pVxqCGzDc4olwHxI3gXdY6AVviqo3VbQ0yYWbMm1lW/2129v 9cBA== X-Gm-Message-State: APjAAAUtKuqAs2jEwRRCWDAU4DjYuAzf2kERfPg3Nf0t2RR3dRbcxa8p XP+YRFYqVV2YHXCtFiSIK/gAHw== X-Google-Smtp-Source: APXvYqwQm/PKNbxhEqmFnaOjT9/9UDavp01EEMEToTFqeXBz6eLzZu35gbHfj6Ya4isY3IuKbymJFQ== X-Received: by 2002:a1c:2283:: with SMTP id i125mr3734296wmi.24.1553003213683; Tue, 19 Mar 2019 06:46:53 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id l5sm1493947wmi.24.2019.03.19.06.46.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 06:46:52 -0700 (PDT) Date: Tue, 19 Mar 2019 13:46:50 +0000 From: Leif Lindholm To: Ming Huang Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, hao.a.wu@intel.com, michael.d.kinney@intel.com, liming.gao@intel.com, ard.biesheuvel@linaro.org, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, mengfanrong@huawei.com, huangdaode@hisilicon.com Message-ID: <20190319134650.vlohpalhrm7ldaqf@bivouac.eciton.net> References: <20190319125913.19187-1-ming.huang@linaro.org> <20190319125913.19187-2-ming.huang@linaro.org> MIME-Version: 1.0 In-Reply-To: <20190319125913.19187-2-ming.huang@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 13:46:58 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Thanks, Ming. On Tue, Mar 19, 2019 at 08:59:13PM +0800, Ming Huang wrote: > The system environment: virtual-CDROM(USB interface) via BMC, insert a > iso file to CDROM, like ubuntu-18.04.1-server-arm64.iso, change CDROM > to first boot option. > With release version bios, disconnecting CDROM when boot to > "1 seconds left, Press Esc or F2 to enter Setup" > then system will get a exception. > > The root cause is the EFI_BLOCK_IO_PROTOCOL for UsbMass will be uninstalled > in this situation after print some transfer error. The status will be > invalid parameter. This line will get a exception for BlockIo not point > to right address: > AllocatePool (BlockIo->Media->BlockSize) > So, here need to judge the status after ASSERT_EFI_ERROR. > > The Bugzilla tracker for this: > https://bugzilla.tianocore.org/show_bug.cgi?id=1631 > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ming Huang Reviewed-by: Leif Lindholm > --- > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > index 4ce83ce22d61..0535cd7335b4 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > @@ -1069,6 +1069,9 @@ BmExpandMediaDevicePath ( > // > Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo); > ASSERT_EFI_ERROR (Status); > + if (EFI_ERROR (Status)) { > + return NULL; > + } > Buffer = AllocatePool (BlockIo->Media->BlockSize); > if (Buffer != NULL) { > BlockIo->ReadBlocks ( > -- > 2.9.5 >