From: Justin Pettit Date: Tue, 23 Dec 2008 08:30:38 +0000 (-0800) Subject: Fix setting "of" device name based on unitialized dp_idx. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faa47744f0d0ad4d1987d9722d15897d788625f4;p=openvswitch Fix setting "of" device name based on unitialized dp_idx. The name of the "of" device is of the form "of". The device driver assumes the "dp_idx" field has been set in the datapath struct before its called. This was not the case. --- diff --git a/datapath/datapath.c b/datapath/datapath.c index c4e6a9f6..baf1d405 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -261,12 +261,13 @@ static int new_dp(int dp_idx) if (dp == NULL) goto err_unlock; + dp->dp_idx = dp_idx; + /* Setup our "of" device */ err = dp_dev_setup(dp); if (err) goto err_free_dp; - dp->dp_idx = dp_idx; dp->chain = chain_create(dp); if (dp->chain == NULL) goto err_destroy_dp_dev;