[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/sysctl: Fix NULL pointer dereference in error path



On 12/01/17 10:13, Jan Beulich wrote:
>>>> On 11.01.17 at 18:57, <andrew.cooper3@xxxxxxxxxx> wrote:
>> --- a/xen/arch/x86/sysctl.c
>> +++ b/xen/arch/x86/sysctl.c
>> @@ -229,7 +229,10 @@ long arch_do_sysctl(
>>  
>>          /* Bad featureset index? */
>>          if ( !p )
>> +        {
>>              ret = -EINVAL;
>> +            break;
>> +        }
>>  
>>          cpuid_policy_to_featureset(p, featureset);
> Considering how the following code is written, adding an "else"
> would seem more natural. With the patch above the !ret check
> right out of context would then be dead code. With either of
> the possible adjustments
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Good point - I will make that adjustment.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.