Found by valgrind.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
static void
dealloc_ofp_port(const struct ofproto *ofproto, uint16_t ofp_port)
{
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
}
/* Opens and returns a netdev for 'ofproto_port' in 'ofproto', or a null