[ovs-dev] [PATCH] bridge: Fix null pointer dereference.

Ben Pfaff blp at nicira.com
Fri Jul 1 17:18:46 UTC 2011


Pushed.

On Fri, Jul 01, 2011 at 10:17:14AM -0700, Justin Pettit wrote:
> Looks good.
> 
> --Justin
> 
> 
> On Jul 1, 2011, at 10:14 AM, Ben Pfaff wrote:
> 
> > 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 <arosen at clemson.edu>
> > ---
> > vswitchd/bridge.c |    2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> > index 9354403..446f4fc 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);
> >             }
> > -- 
> > 1.7.4.4
> > 
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev
> 





More information about the dev mailing list