Commit f0a98ae8 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarJesse Gross <jesse@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40e4783e
...@@ -127,8 +127,10 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops, ...@@ -127,8 +127,10 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops,
vport->ops = ops; vport->ops = ops;
vport->percpu_stats = alloc_percpu(struct vport_percpu_stats); vport->percpu_stats = alloc_percpu(struct vport_percpu_stats);
if (!vport->percpu_stats) if (!vport->percpu_stats) {
kfree(vport);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
spin_lock_init(&vport->stats_lock); spin_lock_init(&vport->stats_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment