Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddfd1f04 authored by Joern Engel's avatar Joern Engel
Browse files

[LogFS] Plug memory leak on error paths

Spotted by Dan Carpenter.
parent ef6ada3d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);