aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-12-05 15:27:07 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-06 12:58:57 -0500
commitf0a98ae8db603494d40e8ec9d7d2dfd41c9f6dc8 (patch)
tree39f1e19a513024df3b5e5949ce7f5c125f2341b4 /net/openvswitch
parent40e4783ee62ac656a9a0fa3b512b6aee4f07d2d1 (diff)
openvswitch: small potential memory leak in ovs_vport_alloc()
We're unlikely to hit this leak, but the static checkers complain if we don't take care of it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 6cd760131f15..7f0ef3794c51 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,
127 vport->ops = ops; 127 vport->ops = ops;
128 128
129 vport->percpu_stats = alloc_percpu(struct vport_percpu_stats); 129 vport->percpu_stats = alloc_percpu(struct vport_percpu_stats);
130 if (!vport->percpu_stats) 130 if (!vport->percpu_stats) {
131 kfree(vport);
131 return ERR_PTR(-ENOMEM); 132 return ERR_PTR(-ENOMEM);
133 }
132 134
133 spin_lock_init(&vport->stats_lock); 135 spin_lock_init(&vport->stats_lock);
134 136