Skip to content

Commit

Permalink
[LogFS] Plug memory leak on error paths
Browse files Browse the repository at this point in the history
Spotted by Dan Carpenter.
  • Loading branch information
Joern Engel committed Nov 23, 2009
1 parent ef6ada3 commit ddfd1f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/logfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ddfd1f0

Please sign in to comment.