From faa47744f0d0ad4d1987d9722d15897d788625f4 Mon Sep 17 00:00:00 2001
From: Justin Pettit <jpettit@nicira.com>
Date: Tue, 23 Dec 2008 00:30:38 -0800
Subject: [PATCH] Fix setting "of" device name based on unitialized dp_idx.

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index c4e6a9f6a..baf1d4056 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;
-- 
2.47.0