Theoretically, it's possible for netdev_get_status() to be called on a netdev-vport which hasn't had it's configuration set yet. In this case, netdev-vport would dereference a null pointer. This problem was found by Jesse Gross <je...@nicira.com> in review.
Signed-off-by: Ethan Jackson <et...@nicira.com> --- lib/netdev-vport.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index e50103b..9bb5d36 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -460,6 +460,12 @@ netdev_vport_get_tnl_iface(const struct netdev *netdev) static char name[IFNAMSIZ]; ndv = netdev_dev_vport_cast(netdev_get_dev(netdev)); + if (!ndv->options) { + /* Race condition when 'ndv' was created, but did not have it's + * configuration set yet. */ + return NULL; + } + if (tnl_port_config_from_nlattr(ndv->options->data, ndv->options->size, a)) { return NULL; -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev