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

Re: [Xen-devel] [PATCH] tools/xl: fix uninitialized variable in xl_vdispl



On Tue, Mar 13, 2018 at 10:56:35AM +0000, George Dunlap wrote:
> On 03/13/2018 04:43 AM, Doug Goldstein wrote:
> > The code added in 7a48622a78a0b452e8afa55b8442c958abd226a7 could use rc
> > uninitialized in main_vdisplattach().
> > 
> > Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
> 
> It looks like that was designed on purpose to use the uninitialized
> warnings to catch paths where the rc wasn't specifically set.
> 
> The only path where it's not set is if dryrun_only is true; and in that
> case, we probably actually want it to succeed, not fail.
> 
> No matter what, rc = 0 should be added to the dryrun_only path.  If we
> want to make ERROR_FAIL the default, then the various places rc is set
> to ERROR_FAIL should be removed.

Yeah, CODING_STYLE dictates rc to not be initialised.

Setting rc = 0 in the appropriate place is the right solution.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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