]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: don't leak a locked dquot when xfs_dquot_attach_buf fails
authorChristoph Hellwig <hch@lst.de>
Mon, 10 Nov 2025 13:22:53 +0000 (14:22 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 11 Nov 2025 10:45:22 +0000 (11:45 +0100)
commit204c8f77e8d4a3006f8abe40331f221a597ce608
treee30bdabfb55a710e02c901f4c14ecaed934779b2
parent0ec73eb3f12350799c4b3fb764225f6e38b42d1e
xfs: don't leak a locked dquot when xfs_dquot_attach_buf fails

xfs_qm_quotacheck_dqadjust acquired the dquot through xfs_qm_dqget,
which means it owns a reference and holds q_qlock.  Both need to
be dropped on an error exit.

Cc: <stable@vger.kernel.org> # v6.13
Fixes: ca378189fdfa ("xfs: convert quotacheck to attach dquot buffers")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_qm.c