datapath: Don't free vport until all references are gone.
authorJesse Gross <jesse@nicira.com>
Thu, 24 Feb 2011 22:16:24 +0000 (14:16 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 25 Feb 2011 01:20:08 +0000 (17:20 -0800)
commit8338302d5cecb0a082104a8ff09544c2909d4308
tree63253a3b3e41709ee232bbfd033c98652015dc6c
parenta02e5331f6064a7b9dd11f1091ab9fcb1bbdadcc
datapath: Don't free vport until all references are gone.

We currently call vport_free() for internal devices after the
device is unregistered.  This takes care of callers that use
either RTNL or RCU but not ones that have only a device reference.
In particular, if stats are requested while a datapath is being
unregistered we can try to use the vport data structures which
have already been freed.

Bug #4736

Reported-by: Brad Hall <brad@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/vport-internal_dev.c