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

Re: [Xen-devel] [PATCH] x86/mm: Fix possible increment of uninitialised variable



>>> On 09.09.13 at 19:43, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> Discovered by Coverity, CID 1056101
> 
> When taking the continue branch on the first iteration of the loop, gfn 
> would
> indeed be uninitialised when incremented.  However, as gfn is 
> unconditionally
> constructed from i{1..4} before use in the loop body, having it incremented 
> in
> the loop header is useless.
> 
> Therefore, simply remove it.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> I have compile tested this but not functionally tested it.  It is fairly
> obvious from the code that it was simply wrong in the first place.

Indeed, or else the similar L2 and L3 loops would also have needed
some form of increment.

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®.