From: "Jan Beulich" Subject: Re: [PATCH for-4.5 V6 13/14] Fix freeing of uninitialized pointer Date: Thu, 25 Sep 2014 09:13:33 +0100 Message-ID: <5423EACD0200007800038C40@mail.emea.novell.com> References: <1411534992-27443-1-git-send-email-roy.franz@linaro.org> <1411534992-27443-14-git-send-email-roy.franz@linaro.org> <5422A606020000780003819D@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roy Franz Cc: keir , Ian Campbell , tim , xen-devel , Stefano Stabellini , Fu Wei List-Id: xen-devel@lists.xenproject.org >>> On 24.09.14 at 21:22, wrote: > On Wed, Sep 24, 2014 at 2:07 AM, Jan Beulich wrote: >> --- a/xen/arch/x86/efi/boot.c >> +++ b/xen/arch/x86/efi/boot.c >> @@ -595,11 +595,12 @@ static void __init setup_efi_pci(void) >> struct efi_pci_rom *last = NULL; >> >> status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, NULL); >> - if ( status == EFI_BUFFER_TOO_SMALL ) >> - status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles); >> - if ( !EFI_ERROR(status) ) >> - status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, >> - handles); >> + if ( status != EFI_BUFFER_TOO_SMALL ) >> + return; >> + status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles); >> + if ( EFI_ERROR(status) ) >> + return; >> + status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, handles); >> if ( EFI_ERROR(status) ) >> size = 0; >> > OK, I'll use your version, and move it to the start of the patch series. Did you overlook that I committed it already? Jan