[ovs-dev] [PATCH] ofproto: Initialise return value of modify_flows__

Simon Horman horms at verge.net.au
Sat Jun 14 00:10:06 UTC 2014


On Fri, Jun 13, 2014 at 10:46:07AM -0700, Ben Pfaff wrote:
> On Fri, Jun 13, 2014 at 11:06:09AM +0900, Simon Horman wrote:
> > dd51dae29bccca3 ("ofproto: Move logic for collecting read-only rules into
> > rule_criteria.") modifies modify_flows__ such that the variable error,
> > the return value, may be uninitialised if either of the following is true:
> > 
> > 1. ofproto->ofproto_class->rule_premodify_actions is NULL
> > 2. rules->n is zero
> > 
> > It appears for the "bfd - Verify tunnel down detection" test
> > in the testsuite the first condition is true and the test fails.
> > 
> > This patch assumes that modify_flows__() may succeed without directly
> > checking that rules are modifiable in the second for loop, which was part
> > of the change introduced by dd51dae29bccca3 ("ofproto: Move logic for
> > collecting read-only rules into rule_criteria."). I am assuming that the
> > implication is that it is no longer necessary.
> > 
> > As a result of this assumption this patch simply initialises the
> > return value to 0.
> > 
> > Signed-off-by: Simon Horman <horms at verge.net.au>
> 
> Good catch, thanks!
> 
> I changed the style of the fix to avoid having a top-level function
> 'error' variable at all, and applied that change to master.

Thanks.



More information about the dev mailing list