quota: Fix memory leak when handling corrupted quota file
authorJan Kara <jack@suse.cz>
Tue, 22 Dec 2020 11:09:53 +0000 (12:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:53 +0000 (11:37 +0100)
commit8584d4f31a3a75fe405a9cc05e679d2bfdd4be05
treeb15811b80de5b413c4cdfd48827dec0ca9649d5b
parent3c5304eb180569ae48ffa7bff3ab89ed9fc43e37
quota: Fix memory leak when handling corrupted quota file

[ Upstream commit a4db1072e1a3bd7a8d9c356e1902b13ac5deb8ef ]

When checking corrupted quota file we can bail out and leak allocated
info structure. Properly free info structure on error return.

Reported-by: syzbot+77779c9b52ab78154b08@syzkaller.appspotmail.com
Fixes: 11c514a99bb9 ("quota: Sanity-check quota file headers on load")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/quota/quota_v2.c