Skip to content

Commit

Permalink
ovl: Return -ENOMEM if an allocation fails ovl_lookup()
Browse files Browse the repository at this point in the history
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: 02b69b2 ("ovl: lookup redirects")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Chandan Rajendra <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
Dan Carpenter authored and Miklos Szeredi committed Oct 19, 2017
1 parent b3885bd commit 0ce5cdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/overlayfs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0ce5cdc

Please sign in to comment.