]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
JFS: fix memleak in jfs_mount
authorDongliang Mu <mudongliangabcd@gmail.com>
Sat, 4 Sep 2021 02:37:41 +0000 (10:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:15 +0000 (14:04 +0100)
commit980c7bdd20fcc1a4fddb44f30a455ca313a82dfa
tree066676582afe8a1b56356d2fc0daeae8ae4009cc
parentc4edd206d52ef9671b7af695d44d7d4521b248d2
JFS: fix memleak in jfs_mount

[ Upstream commit c48a14dca2cb57527dde6b960adbe69953935f10 ]

In jfs_mount, when diMount(ipaimap2) fails, it goes to errout35. However,
the following code does not free ipaimap2 allocated by diReadSpecial.

Fix this by refactoring the error handling code of jfs_mount. To be
specific, modify the lable name and free ipaimap2 when the above error
ocurrs.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/jfs/jfs_mount.c