From: Ryusuke Konishi Date: Fri, 22 May 2009 11:36:21 +0000 (+0900) Subject: nilfs2: fix memory leak in nilfs_ioctl_clean_segments X-Git-Tag: firefly_0821_release~14119^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d5046853634a8d73f28bad3cf68d182c4a99035d;p=firefly-linux-kernel-4.4.55.git nilfs2: fix memory leak in nilfs_ioctl_clean_segments This fixes a new memory leak problem in garbage collection. The problem was brought by the bugfix patch ("nilfs2: fix lock order reversal in nilfs_clean_segments ioctl"). Thanks to Kentaro Suzuki for finding this problem. Reported-by: Kentaro Suzuki Signed-off-by: Ryusuke Konishi --- diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index 50ff3f2cdf24..d6759b92006f 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c @@ -576,7 +576,7 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp, ret = nilfs_clean_segments(inode->i_sb, argv, kbufs); out_free: - while (--n > 0) + while (--n >= 0) vfree(kbufs[n]); kfree(kbufs[4]); return ret;