From: Ben Pfaff Date: Fri, 1 Jul 2011 17:13:35 +0000 (-0700) Subject: bridge: Fix null pointer dereference. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=316dec68688aeccc1bbb90e555d9c0ca259d9fc7;p=openvswitch bridge: Fix null pointer dereference. If the netdev_open() fails then iface->netdev will be NULL and iface_refresh_stats() will cause a null pointer dereference in netdev_get_stats(). Fixes a problem introduced by commit 1101a0b47 "bridge: Populate interface status/statistics as soon as a port is added." Reported-by: Aaron Rosen --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 93544032..446f4fc0 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -869,7 +869,7 @@ bridge_add_ofproto_ports(struct bridge *br) } /* Populate stats columns in new Interface rows. */ - if (!iface->cfg->mtu) { + if (iface->netdev && !iface->cfg->mtu) { iface_refresh_stats(iface); iface_refresh_status(iface); }