Skip to content

Commit bea906e

Browse files
author
Andreas Gruenbacher
committed
gfs2: Silence possible null pointer dereference warning
In gfs2_rbm_find, rs is always NULL when minext is NULL, so gfs2_reservation_check_and_update will never be called on a NULL minext. This isn't innediately obvious though, so also check for a NULL minext for better code readability. Reported-by: kernel test robot <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 6d8da30 commit bea906e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/gfs2/rgrp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,7 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
17831783
goto next_bitmap;
17841784
}
17851785
rbm->offset = offset;
1786-
if (!rs)
1786+
if (!rs || !minext)
17871787
return 0;
17881788

17891789
ret = gfs2_reservation_check_and_update(rbm, rs, *minext,

0 commit comments

Comments
 (0)