From: "Jan Beulich" Subject: Re: [PATCH for-4.5 V7 11/14] Add arch specific module handling to read_file() Date: Thu, 25 Sep 2014 11:34:54 +0100 Message-ID: <54240BEE0200007800038DE8@mail.emea.novell.com> References: <1411609352-24549-1-git-send-email-roy.franz@linaro.org> <1411609352-24549-12-git-send-email-roy.franz@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1411609352-24549-12-git-send-email-roy.franz@linaro.org> 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@xen.org, ian.campbell@citrix.com, tim@xen.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com, fu.wei@linaro.org List-Id: xen-devel@lists.xenproject.org >>> On 25.09.14 at 03:42, wrote: > + /* > + * Make a copy, as conversion is destructive, and caller still wants > + * wide string available after this call returns. > + */ > + if ( efi_bs->AllocatePool(EfiLoaderData, (wstrlen(name) + 1) * sizeof(*name), > + &ptr) != EFI_SUCCESS ) > + blexit(L"ERROR Unable to allocate string buffer"); Kind of disappointing: You said you'd drop these ERROR prefixes, but this is the second one I come across. I'm ditching them in preparation for committing. > + > + local_name.w = ptr; > + wstrcpy(local_name.w, name); > + w2s(&local_name); > + > + place_string(&mb_modules[mbi.mods_count].string, options); > + place_string(&mb_modules[mbi.mods_count].string, ""); Hmm, this one's still here, and I don't recall having seen an explanation for it. I guess I need to cut off committing at this patch then... > @@ -861,16 +882,16 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) > name.s = get_value(&cfg, section.s, "ramdisk"); > if ( name.s ) > { > - split_value(name.s); > - read_file(dir_handle, s2w(&name), &ramdisk); > + option_str = split_string(name.s); > + read_file(dir_handle, s2w(&name), &ramdisk, option_str); As said before, this should be NULL as not having and never going to have a consumer. Whether you keep the XSM one below is - as also said before - up to you. Jan > efi_bs->FreePool(name.w); > } > > name.s = get_value(&cfg, section.s, "xsm"); > if ( name.s ) > { > - split_value(name.s); > - read_file(dir_handle, s2w(&name), &xsm); > + option_str = split_string(name.s); > + read_file(dir_handle, s2w(&name), &xsm, option_str); > efi_bs->FreePool(name.w); > } >