]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dlm: fix user space lkb refcounting
authorAlexander Aring <aahringo@redhat.com>
Tue, 12 Mar 2024 17:05:07 +0000 (13:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:25 +0000 (15:11 +0200)
commit2da5332d366de9905b851fa6bea82b62198c28a6
tree58493370e6562bd4c8a422153858566ba79a3c9f
parent4e23a57b3729113d7db1e179589c27e04403bb5a
dlm: fix user space lkb refcounting

[ Upstream commit 2ab3d705ca5d4f7ea345a21c3da41a447a549649 ]

This patch fixes to check on the right return value if it was the last
callback. The rv variable got overwritten by the return of
copy_result_to_user(). Fixing it by introducing a second variable for
the return value and don't let rv being overwritten.

Cc: stable@vger.kernel.org
Fixes: 61bed0baa4db ("fs: dlm: use a non-static queue for callbacks")
Reported-by: Valentin Vidić <vvidic@valentin-vidic.from.hr>
Closes: https://lore.kernel.org/gfs2/Ze4qSvzGJDt5yxC3@valentin-vidic.from.hr
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/dlm/user.c