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

Re: [Xen-devel] [PATCH] x86, amd_ucode: Verify max allowed patch size before apply



>>> On 25.04.14 at 21:48, <aravind.gopalakrishnan@xxxxxxx> wrote:
> On 4/25/2014 2:00 AM, Jan Beulich wrote:
>>>>> On 24.04.14 at 21:54, <aravind.gopalakrishnan@xxxxxxx> wrote:
>>> @@ -370,9 +415,11 @@ static int microcode_resume_match(int cpu, const void 
>>> *mc)
>>>       struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
>>>       struct microcode_amd *mc_amd = uci->mc.mc_amd;
>>>       const struct microcode_amd *src = mc;
>>> +    int error;
>>>   
>>> -    if ( !microcode_fits(src, cpu) )
>>> -        return 0;
>>> +    error = microcode_fits(src, cpu);
>>> +    if ( error )
>>> +        return error;
>> Is it really correct for this to get switched from success to error return?
> 
> Previously, microcode_fits returned '1' for Success, '0' for error. So, 
> the condition returns '0' when return val is '0'
> This mechanism is still preserved in the changes made above..

Definitely not: You return non-zero when "error" is non-zero.

Jan


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


 


Rackspace

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