diff options
author | Geliang Tang <geliangtang@gmail.com> | 2016-11-18 16:02:46 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-16 11:02:57 +0100 |
commit | 313684c48cc0e450ab303e1f82130ee2d0b50274 (patch) | |
tree | dad3e4f69bd80eea599675f79c41c26fa833f80e /fs/overlayfs | |
parent | ovl: clean up kstat usage (diff) | |
download | linux-313684c48cc0e450ab303e1f82130ee2d0b50274.tar.xz linux-313684c48cc0e450ab303e1f82130ee2d0b50274.zip |
ovl: fix return value of ovl_fill_super
If kcalloc() failed, the return value of ovl_fill_super() is -EINVAL,
not -ENOMEM. So this patch sets this value to -ENOMEM before calling
kcalloc(), and sets it back to -EINVAL after calling kcalloc().
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r-- | fs/overlayfs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 7da36ccda438..20f48abbb82f 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -774,10 +774,12 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) goto out_free_lowertmp; } + err = -ENOMEM; stack = kcalloc(stacklen, sizeof(struct path), GFP_KERNEL); if (!stack) goto out_free_lowertmp; + err = -EINVAL; lower = lowertmp; for (numlower = 0; numlower < stacklen; numlower++) { err = ovl_lower_dir(lower, &stack[numlower], ufs, |