summaryrefslogtreecommitdiff
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2021-04-02 20:51:24 +0300
committerAndreas Gruenbacher <agruenba@redhat.com>2021-04-03 22:38:12 +0300
commitbea906ee1624aeb34ea2c5acca84728de4185726 (patch)
tree2e47f1b828f3f14b6a3eab4892ff0bcc9beebc75 /fs/gfs2/rgrp.c
parent6d8da302aedf9ff32c1579cbf91705a78538cb9e (diff)
downloadlinux-bea906ee1624aeb34ea2c5acca84728de4185726.tar.xz
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 <lkp@intel.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 89c37a845e64..2dab313442a7 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1783,7 +1783,7 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
goto next_bitmap;
}
rbm->offset = offset;
- if (!rs)
+ if (!rs || !minext)
return 0;
ret = gfs2_reservation_check_and_update(rbm, rs, *minext,