mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
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: 27fac77707
("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>
This commit is contained in:
parent
a0fc05a37c
commit
880301bb31
@ -1393,10 +1393,10 @@ ok:
|
||||
fc->ops = &ntfs_context_ops;
|
||||
|
||||
return 0;
|
||||
free_opts:
|
||||
kfree(opts);
|
||||
free_sbi:
|
||||
kfree(sbi);
|
||||
free_opts:
|
||||
kfree(opts);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user