Fix setting "of" device name based on unitialized dp_idx.
authorJustin Pettit <jpettit@nicira.com>
Tue, 23 Dec 2008 08:30:38 +0000 (00:30 -0800)
committerJustin Pettit <jpettit@nicira.com>
Tue, 23 Dec 2008 08:30:38 +0000 (00:30 -0800)
The name of the "of" device is of the form "of<dp_idx>".  The device
driver assumes the "dp_idx" field has been set in the datapath struct
before its called.  This was not the case.

datapath/datapath.c

index c4e6a9f6a871cd9eb98111a2d1169142b94665de..baf1d40564ddbcc34b02a0a3ddd4bf08006f7219 100644 (file)
@@ -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;