Commit e0f49d27 authored by Markus Elfring's avatar Markus Elfring Committed by Theodore Ts'o
Browse files

ext4: delete unnecessary checks before brelse()



The brelse() function tests whether its argument is NULL
and then returns immediately.
Thus remove the tests which are not needed around the shown calls.

This issue was detected by using the Coccinelle software.

Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Reviewed-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/0d713702-072f-a89c-20ec-ca70aa83a432@web.de


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent e4d7f2d3
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -693,12 +693,10 @@ void ext4_ext_drop_refs(struct ext4_ext_path *path)
		return;
	depth = path->p_depth;
	for (i = 0; i <= depth; i++, path++) {
		if (path->p_bh) {
		brelse(path->p_bh);
		path->p_bh = NULL;
	}
}
}

/*
 * ext4_ext_binsearch_idx:
+1 −2
Original line number Diff line number Diff line
@@ -1356,7 +1356,6 @@ retry:

	block = 0;
	while (wsize < bufsize) {
		if (bh != NULL)
		brelse(bh);
		csize = (bufsize - wsize) > blocksize ? blocksize :
								bufsize - wsize;