From: Joern Engel Date: Mon, 23 Nov 2009 13:29:12 +0000 (+0100) Subject: [LogFS] Plug memory leak on error paths X-Git-Tag: Ubuntu-snapdragon-4.4.0-1050.54~22729^2~7 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ddfd1f04b7bc557c1fe9b110e99cebb2e19d4993;p=mirror_ubuntu-artful-kernel.git [LogFS] Plug memory leak on error paths Spotted by Dan Carpenter. --- diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c index 89104e6f81c4..e7659b15a907 100644 --- a/fs/logfs/dir.c +++ b/fs/logfs/dir.c @@ -224,10 +224,14 @@ static int logfs_unlink(struct inode *dir, struct dentry *dentry) inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; page = logfs_get_dd_page(dir, dentry); - if (!page) + if (!page) { + kfree(ta); return -ENOENT; - if (IS_ERR(page)) + } + if (IS_ERR(page)) { + kfree(ta); return PTR_ERR(page); + } index = page->index; page_cache_release(page);