From: Dan Carpenter Date: Fri, 22 Sep 2017 20:45:18 +0000 (+0300) Subject: ovl: Return -ENOMEM if an allocation fails ovl_lookup() X-Git-Tag: v4.14-rc7~9^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ce5cdc9d79277e55c3d80bf7d2b1adea2752078;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Chandan Rajendra Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 654bea1..e081641 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, } if (d.redirect) { + err = -ENOMEM; upperredirect = kstrdup(d.redirect, GFP_KERNEL); if (!upperredirect) goto out_put_upper;