Skip to content

Commit 58f6e78

Browse files
Zhihao Chengrichardweinberger
authored andcommitted
ubifs: dent: Fix some potential memory leaks while iterating entries
Fix some potential memory leaks in error handling branches while iterating dent entries. For example, function dbg_check_dir() forgets to free pdent if it exists. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Cc: <stable@vger.kernel.org> Fixes: 1e51764 ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent f2aae74 commit 58f6e78

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/ubifs/debug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,7 @@ int dbg_check_dir(struct ubifs_info *c, const struct inode *dir)
11231123
err = PTR_ERR(dent);
11241124
if (err == -ENOENT)
11251125
break;
1126+
kfree(pdent);
11261127
return err;
11271128
}
11281129

0 commit comments

Comments
 (0)