Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bccaef90 authored by Markus Elfring's avatar Markus Elfring Committed by Andreas Gruenbacher
Browse files

gfs2: Delete an unnecessary check before brelse()



The brelse() function tests whether its argument is NULL and then
returns immediately.  Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

[The same applies to brelse() in gfs2_dir_no_add (which Coccinelle
apparently missed), so fix that as well.]

Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 45eb0504
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1463,7 +1463,6 @@ static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx,
				sort_offset : entries, copied);
out_free:
	for(i = 0; i < leaf; i++)
		if (larr[i])
		brelse(larr[i]);
	kvfree(larr);
out:
+1 −2
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ extern int gfs2_dir_add(struct inode *inode, const struct qstr *filename,
			const struct gfs2_inode *ip, struct gfs2_diradd *da);
static inline void gfs2_dir_no_add(struct gfs2_diradd *da)
{
	if (da->bh)
	brelse(da->bh);
	da->bh = NULL;
}