diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-09-22 16:45:18 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-10-19 10:19:52 -0400 |
commit | 0ce5cdc9d79277e55c3d80bf7d2b1adea2752078 (patch) | |
tree | 63a093a0e017fd8064ee8a98de5f383593dcf42a | |
parent | b3885bd6edb41b91a0e3976469f72ae31bfb8d95 (diff) |
ovl: Return -ENOMEM if an allocation fails ovl_lookup()
The error code is missing here so it means we return ERR_PTR(0) or NULL.
The other error paths all return an error code so this probably should
as well.
Fixes: 02b69b284cd7 ("ovl: lookup redirects")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-rw-r--r-- | fs/overlayfs/namei.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 654bea1a5ac9..e08164156cfe 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c | |||
@@ -635,6 +635,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry, | |||
635 | } | 635 | } |
636 | 636 | ||
637 | if (d.redirect) { | 637 | if (d.redirect) { |
638 | err = -ENOMEM; | ||
638 | upperredirect = kstrdup(d.redirect, GFP_KERNEL); | 639 | upperredirect = kstrdup(d.redirect, GFP_KERNEL); |
639 | if (!upperredirect) | 640 | if (!upperredirect) |
640 | goto out_put_upper; | 641 | goto out_put_upper; |