summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2020-06-01 12:10:37 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-05 13:08:52 +0300
commitb08433b1c5e581c8824c190f3827107bd8db05cf (patch)
treefbd2fdef1d4ce1ffaef2c4972fba1d0e0f0bba1c /fs
parent88401813fcec150ff179e731364fc19af1e6632f (diff)
downloadlinux-b08433b1c5e581c8824c190f3827107bd8db05cf.tar.xz
ubifs: dent: Fix some potential memory leaks while iterating entries
commit 58f6e78a65f1fcbf732f60a7478ccc99873ff3ba upstream. 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: 1e51764a3c2ac05a2 ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/debug.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 564e330d05b1..24bbecd4752b 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -1129,6 +1129,7 @@ int dbg_check_dir(struct ubifs_info *c, const struct inode *dir)
err = PTR_ERR(dent);
if (err == -ENOENT)
break;
+ kfree(pdent);
return err;
}