[U-Boot] [PATCH 1/1] vsprintf.c: add EFI device path printing
Heinrich Schuchardt
xypron.debian at gmx.de
Sun Nov 19 13:50:55 UTC 2017
On 11/19/2017 12:41 PM, Wolfgang Denk wrote:
> Dear Heinrich,
>
> In message <20171118110946.26014-1-xypron.glpk at gmx.de> you wrote:
>> For debugging efi_loader we need the capability to print EFI
>> device paths. With this patch we can write:
>>
>> debug("device path: %pD", dp);
> ...
>
>> +#ifdef CONFIG_EFI_LOADER
>> +static char *device_path_string(char *buf, char *end, void *dp, int field_width,
>> + int precision, int flags)
>> +{
>> + u16 *str = efi_dp_str((struct efi_device_path *)dp);
>> +
>> + buf = string16(buf, end, str, field_width, precision, flags);
>> + efi_free_pool(str);
>
> efi_dp_str() can return NULL. Should this not be handled?
Thanks for reviewing.
This situation is caught in string16:
u16 *str = s ? s : L"<NULL>";
It can only occur if we are out of memory. All other error handling
should be added to efi_convert_device_path_to_text().
Best regards
Heinrich
More information about the U-Boot
mailing list