diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-08-24 10:51:04 +0300 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2021-08-27 17:05:14 +0300 |
commit | b8155e95de38b25a69dfb03e4731fd6c5a28531e (patch) | |
tree | cfd1fbd953fe01926acc0c44a891ff0094679c08 /fs/ntfs3/lznt.c | |
parent | 8c83a4851da1c7eda83098ade238665b15774da3 (diff) | |
download | linux-b8155e95de38b25a69dfb03e4731fd6c5a28531e.tar.gz linux-b8155e95de38b25a69dfb03e4731fd6c5a28531e.tar.bz2 linux-b8155e95de38b25a69dfb03e4731fd6c5a28531e.zip |
fs/ntfs3: Fix error handling in indx_insert_into_root()
There are three bugs in this code:
1) If indx_get_root() fails, then return -EINVAL instead of success.
2) On the "/* make root external */" -EOPNOTSUPP; error path it should
free "re" but it has a memory leak.
3) If indx_new() fails then it will lead to an error pointer dereference
when we call put_indx_node().
I've re-written the error handling to be more clear.
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/lznt.c')
0 files changed, 0 insertions, 0 deletions