On 21.11.2023 18:23, Andrew Cooper wrote:
> On 21/11/2023 8:21 am, Jan Beulich wrote:
>> On 20.11.2023 23:49, Andrew Cooper wrote:
>>> --- a/xen/arch/x86/setup.c
>>> +++ b/xen/arch/x86/setup.c
>>> @@ -837,9 +837,10 @@ static bool __init loader_is_grub2(const char
>>> *loader_name)
>>> return (p != NULL) && (p[5] != '0');
>>> }
>>>
>>> -static char * __init cmdline_cook(char *p, const char *loader_name)
>>> +static const char *__init cmdline_cook(const char *p, const char
>>> *loader_name)
>>> {
>>> - p = p ? : "";
>>> + if ( !p )
>>> + return "";
>> This change is now needed only for create_dom0(), whereas the call site
>> change to __start_xen() is redundant with the change here. Did you
>> consider doing a similar transformation in create_dom0(), thus
>> eliminating the need for this check altogether? Alternatively I'd like
>> to ask that ...
>
> It occurs to me that __va(0) != 0, so this path isn't actually taken,
> even when there is a bad mbi-> pointer.
But it is taken when the (remaining) caller passes in NULL explicitly (from
the conditional operator ahead of the function invocation). But anyway, I'll
go look at v2.
Jan