summaryrefslogtreecommitdiff
path: root/fs/f2fs/extent_cache.c
diff options
context:
space:
mode:
authorRoi Martin <jroi.martin@gmail.com>2024-10-09 10:08:33 +0200
committerDavid Sterba <dsterba@suse.com>2024-10-11 19:54:52 +0200
commit66691c6e2f18d2aa4b22ffb624b9bdc97e9979e4 (patch)
tree9d03720ba384fa0ef0ca7268a777bd2a24c2b912 /fs/f2fs/extent_cache.c
parent97420be7bda57030110c7032ad190d320f2e0157 (diff)
btrfs: fix uninitialized pointer free in add_inode_ref()
The add_inode_ref() function does not initialize the "name" struct when it is declared. If any of the following calls to "read_one_inode() returns NULL, dir = read_one_inode(root, parent_objectid); if (!dir) { ret = -ENOENT; goto out; } inode = read_one_inode(root, inode_objectid); if (!inode) { ret = -EIO; goto out; } then "name.name" would be freed on "out" before being initialized. out: ... kfree(name.name); This issue was reported by Coverity with CID 1526744. Fixes: e43eec81c516 ("btrfs: use struct qstr instead of name and namelen pairs") CC: stable@vger.kernel.org # 6.6+ Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Roi Martin <jroi.martin@gmail.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/f2fs/extent_cache.c')
0 files changed, 0 insertions, 0 deletions