fs/ntfs3: Fix invalid free in log_replay
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 30 May 2022 15:43:01 +0000 (18:43 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 31 May 2022 14:29:29 +0000 (17:29 +0300)
commitf26967b9f7a830e228bb13fb41bd516ddd9d789d
treeb5ba4fcc3c18f14c8695cc89c4032e4862921a65
parent03ab8e6297acd1bc0eedaa050e2a1635c576fd11
fs/ntfs3: Fix invalid free in log_replay

log_read_rst() returns ENOMEM error when there is not enough memory.
In this case, if info is returned without initialization,
it attempts to kfree the uninitialized info->r_page pointer. This patch
moves the memset initialization code to before log_read_rst() is called.

Reported-by: Gerald Lee <sundaywind2004@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/fslog.c