From: Sudip Mukherjee Date: Fri, 22 Jan 2016 00:40:36 +0000 (-0800) Subject: reiserfs: fix dereference of ERR_PTR X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff7d080e528d8faf5bc175fd9909889af03e1566;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git reiserfs: fix dereference of ERR_PTR reiserfs_iget() returns either NULL or error code in ERR_PTR. And we were only checking for NULL, so in case of some other error we will try to dereference the ERR_PTR(-errno) thinking it to be a valid pointer. Signed-off-by: Sudip Mukherjee Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 05db7473bcb5..c0306ec8ed7b 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -288,7 +288,7 @@ static int finish_unfinished(struct super_block *s) pathrelse(&path); inode = reiserfs_iget(s, &obj_key); - if (!inode) { + if (IS_ERR_OR_NULL(inode)) { /* * the unlink almost completed, it just did not * manage to remove "save" link and release objectid