Skip to content

Commit 30badc9

Browse files
elfringswhiteho
authored andcommitted
GFS2: Deletion of unnecessary checks before two function calls
The functions iput() and put_pid() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
1 parent 2e60d76 commit 30badc9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/gfs2/glock.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,8 +836,7 @@ void gfs2_holder_reinit(unsigned int state, unsigned flags, struct gfs2_holder *
836836
gh->gh_flags = flags;
837837
gh->gh_iflags = 0;
838838
gh->gh_ip = _RET_IP_;
839-
if (gh->gh_owner_pid)
840-
put_pid(gh->gh_owner_pid);
839+
put_pid(gh->gh_owner_pid);
841840
gh->gh_owner_pid = get_pid(task_pid(current));
842841
}
843842

0 commit comments

Comments
 (0)