From: Andreas Gruenbacher Date: Fri, 2 Apr 2021 17:51:24 +0000 (+0200) Subject: gfs2: Silence possible null pointer dereference warning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bea906ee1624aeb34ea2c5acca84728de4185726;p=linux.git 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 Signed-off-by: Andreas Gruenbacher --- diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 89c37a845e649..2dab313442a70 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,