return err;
 }
 
-static int ovl_get_tmpfile(struct dentry *workdir, struct dentry *upperdir,
-                          struct dentry *dentry,
+static int ovl_get_tmpfile(struct dentry *workdir, struct dentry *dentry,
                           struct kstat *stat, const char *link, bool tmpfile,
                           struct dentry **tempp)
 {
                old_creds = override_creds(new_creds);
 
        if (tmpfile) {
-               temp = ovl_do_tmpfile(upperdir, stat->mode);
+               temp = ovl_do_tmpfile(workdir, stat->mode);
                if (IS_ERR(temp))
                        goto temp_err;
        } else {
        struct dentry *temp = NULL;
        int err;
 
-       err = ovl_get_tmpfile(workdir, upperdir, dentry, stat, link, tmpfile,
-                             &temp);
+       err = ovl_get_tmpfile(workdir, dentry, stat, link, tmpfile, &temp);
        if (err)
                goto out;