]> git.baikalelectronics.ru Git - kernel.git/commit
fs/ntfs3: Fix a memory leak on object opts
authorColin Ian King <colin.king@canonical.com>
Fri, 10 Sep 2021 10:02:02 +0000 (11:02 +0100)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 20 Sep 2021 15:53:12 +0000 (18:53 +0300)
commit1931cd3513792dce27371acb2eda5008d6836bf5
tree9120d942b060209932642f8344cb22ba4559d4df
parentd15a8131e034d0c921af6f1e17038afbd214e53d
fs/ntfs3: Fix a memory leak on object opts

Currently a failed allocation on sbi->upcase will cause an exit via
the label free_sbi causing a memory leak on object opts. Fix this by
re-ordering the exit paths free_opts and free_sbi so that kfree's occur
in the reverse allocation order.

Addresses-Coverity: ("Resource leak")
Fixes: 57d68f800a9a ("fs/ntfs3: Init spi more in init_fs_context than fill_super")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/super.c