projects
/
profile
/
common
/
kernel-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40e4783
)
openvswitch: small potential memory leak in ovs_vport_alloc()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Mon, 5 Dec 2011 20:27:07 +0000
(20:27 +0000)
committer
David S. Miller
<davem@davemloft.net>
Tue, 6 Dec 2011 17:58:57 +0000
(12:58 -0500)
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>
net/openvswitch/vport.c
patch
|
blob
|
history
diff --git
a/net/openvswitch/vport.c
b/net/openvswitch/vport.c
index
6cd7601
..
7f0ef37
100644
(file)
--- 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);