If inserting a flow failed and we need to free the actions, we
currently directly free them from the flow struct. This is fine
but it makes sparse complain about directly accessing an RCU
protected field. We could insert some casts to avoid this but
it's cleaner to just free the data from the local variable
instead.
Found with sparse.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
struct tbl_node *flow_node;
struct sw_flow *flow;
struct tbl *table;
+ struct sw_flow_actions *acts = NULL;
int error;
u32 hash;
flow_node = tbl_lookup(table, &uf->flow.key, hash, flow_cmp);
if (!flow_node) {
/* No such flow. */
- struct sw_flow_actions *acts;
-
error = -ENOENT;
if (!(uf->flags & ODPPF_CREATE))
goto error;
return 0;
error_free_flow_acts:
- kfree(flow->sf_acts);
+ kfree(acts);
error_free_flow:
flow->sf_acts = NULL;
flow_put(flow);