Skip to content

Commit

Permalink
reiserfs: fix dereference of ERR_PTR
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and torvalds committed Jan 22, 2016
1 parent c2594bc commit ff7d080
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/reiserfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff7d080

Please sign in to comment.