git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bceafb6
)
ofproto: Avoid wild write removing OFPP_LOCAL port in dealloc_ofp_port().
author
Ben Pfaff
<blp@nicira.com>
Thu, 24 Jan 2013 19:51:54 +0000
(11:51 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Thu, 24 Jan 2013 19:51:54 +0000
(11:51 -0800)
Found by valgrind.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto.c
patch
|
blob
|
history
diff --git
a/ofproto/ofproto.c
b/ofproto/ofproto.c
index
9bae971
..
b6cd082
100644
(file)
--- a/
ofproto/ofproto.c
+++ b/
ofproto/ofproto.c
@@
-1644,7
+1644,9
@@
alloc_ofp_port(struct ofproto *ofproto, const char *netdev_name)
static void
dealloc_ofp_port(const struct ofproto *ofproto, uint16_t ofp_port)
{
- bitmap_set0(ofproto->ofp_port_ids, ofp_port);
+ if (ofp_port < ofproto->max_ports) {
+ bitmap_set0(ofproto->ofp_port_ids, ofp_port);
+ }
}
/* Opens and returns a netdev for 'ofproto_port' in 'ofproto', or a null