devtmpfs: missing initialialization in never-hit case
[pandora-kernel.git] / drivers / base / devtmpfs.c
index a49897d..33e1bed 100644 (file)
@@ -164,34 +164,28 @@ static int dev_mkdir(const char *name, mode_t mode)
 
 static int create_path(const char *nodepath)
 {
-       int err;
+       char *path;
+       char *s;
+       int err = 0;
 
-       err = dev_mkdir(nodepath, 0755);
-       if (err == -ENOENT) {
-               char *path;
-               char *s;
+       /* parent directories do not exist, create them */
+       path = kstrdup(nodepath, GFP_KERNEL);
+       if (!path)
+               return -ENOMEM;
 
-               /* parent directories do not exist, create them */
-               path = kstrdup(nodepath, GFP_KERNEL);
-               if (!path) {
-                       err = -ENOMEM;
-                       goto out;
-               }
-               s = path;
-               for (;;) {
-                       s = strchr(s, '/');
-                       if (!s)
-                               break;
-                       s[0] = '\0';
-                       err = dev_mkdir(path, 0755);
-                       if (err && err != -EEXIST)
-                               break;
-                       s[0] = '/';
-                       s++;
-               }
-               kfree(path);
+       s = path;
+       for (;;) {
+               s = strchr(s, '/');
+               if (!s)
+                       break;
+               s[0] = '\0';
+               err = dev_mkdir(path, 0755);
+               if (err && err != -EEXIST)
+                       break;
+               s[0] = '/';
+               s++;
        }
-out:
+       kfree(path);
        return err;
 }
 
@@ -412,9 +406,10 @@ static int devtmpfsd(void *p)
                        requests = NULL;
                        spin_unlock(&req_lock);
                        while (req) {
+                               struct req *next = req->next;
                                req->err = handle(req->name, req->mode, req->dev);
                                complete(&req->done);
-                               req = req->next;
+                               req = next;
                        }
                        spin_lock(&req_lock);
                }