Merge branch 'regulator-4.20' into regulator-linus
[linux-2.6-block.git] / fs / exofs / super.c
index 41cf2fbee50da4cb9ec0999a967d7d777fb7fc45..906839a4da8ff8215f7a18f26030cfbc18b9b0e3 100644 (file)
@@ -101,6 +101,7 @@ static int parse_options(char *options, struct exofs_mountopt *opts)
                token = match_token(p, tokens, args);
                switch (token) {
                case Opt_name:
+                       kfree(opts->dev_name);
                        opts->dev_name = match_strdup(&args[0]);
                        if (unlikely(!opts->dev_name)) {
                                EXOFS_ERR("Error allocating dev_name");
@@ -117,7 +118,7 @@ static int parse_options(char *options, struct exofs_mountopt *opts)
                                          EXOFS_MIN_PID);
                                return -EINVAL;
                        }
-                       s_pid = 1;
+                       s_pid = true;
                        break;
                case Opt_to:
                        if (match_int(&args[0], &option))
@@ -866,8 +867,10 @@ static struct dentry *exofs_mount(struct file_system_type *type,
        int ret;
 
        ret = parse_options(data, &opts);
-       if (ret)
+       if (ret) {
+               kfree(opts.dev_name);
                return ERR_PTR(ret);
+       }
 
        if (!opts.dev_name)
                opts.dev_name = dev_name;