--- x/fs/overlayfs/super.c +++ y/fs/overlayfs/super.c @@ -695,7 +695,7 @@ static int ovl_make_workdir(struct super tmpfile = ovl_do_tmpfile(ofs, ofs->workdir, S_IFREG | 0); ofs->tmpfile = !IS_ERR(tmpfile); if (ofs->tmpfile) - fput(tmpfile); + ; else pr_warn("upper fs does not support tmpfile.\n"); @@ -790,6 +790,8 @@ static int ovl_make_workdir(struct super } out: mnt_drop_write(mnt); + if (ofs->tmpfile) + fput(tmpfile); return err; }