If the allocation of percpu stats fails when creating a new
datapath, we currently don't return the correct error code. Since
we don't explicitly set it when the allocation fails it will keep
the value from the previous call. This means we will return success
when the creation actually failed.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
dp->drop_frags = 0;
dp->stats_percpu = alloc_percpu(struct dp_stats_percpu);
- if (!dp->stats_percpu)
+ if (!dp->stats_percpu) {
+ err = -ENOMEM;
goto err_destroy_local_port;
+ }
rcu_assign_pointer(dps[dp_idx], dp);
dp_sysfs_add_dp(dp);