summaryrefslogtreecommitdiffstats
path: root/net/openvswitch
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch')
-rw-r--r--net/openvswitch/vport.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 6cd760131f1..7f0ef3794c5 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -127,8 +127,10 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops,
vport->ops = ops;
vport->percpu_stats = alloc_percpu(struct vport_percpu_stats);
- if (!vport->percpu_stats)
+ if (!vport->percpu_stats) {
+ kfree(vport);
return ERR_PTR(-ENOMEM);
+ }
spin_lock_init(&vport->stats_lock);