gfs2: Fix error handling in init_statfs
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 28 Jun 2021 11:14:50 +0000 (19:14 +0800)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 28 Jun 2021 12:30:00 +0000 (14:30 +0200)
commit5d49d3508b3c67201bd3e1bf7f4ef049111b7051
treee42ddf6deaaff608671bfe778d2016e3e6dad8f9
parentd3c51c55cb9274dd43c156f1f26b5eb4d5f2d58c
gfs2: Fix error handling in init_statfs

On an error path, init_statfs calls iput(pn) after pn has already been put.
Fix that by setting pn to NULL after the initial iput.

Fixes: 97fd734ba17e ("gfs2: lookup local statfs inodes prior to journal recovery")
Cc: stable@vger.kernel.org # v5.10+
Reported-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/ops_fstype.c