dpif-linux: Always set *fnp in make_openvswitch_device().
authorBen Pfaff <blp@nicira.com>
Tue, 19 Jan 2010 18:10:52 +0000 (10:10 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 19 Jan 2010 18:10:52 +0000 (10:10 -0800)
Some versions of GCC warn about this.  Always initializing it seems like
the right thing to do, since we "almost always" initialized it before.

Reported-by: Neil McKee <neil.mckee@inmon.com>
lib/dpif-linux.c

index b7ba3062e86da1f1902c9595d2f2269b645f96b3..e7d43811dc66068cc8dece6a12e6e487318a3b17 100644 (file)
@@ -571,13 +571,14 @@ make_openvswitch_device(int minor, char **fnp)
     struct stat s;
     char fn[128];
 
+    *fnp = NULL;
+
     major = get_openvswitch_major();
     if (major < 0) {
         return -major;
     }
     dev = makedev(major, minor);
 
-    *fnp = NULL;
     sprintf(fn, "%s/dp%d", dirname, minor);
     if (!stat(fn, &s)) {
         if (!S_ISCHR(s.st_mode)) {