2004-04-30 22:31:43

by Junfeng Yang

[permalink] [raw]
Subject: [CHECKER] Memory Leak on commonly executed path in jfs_link (JFS 2.4, kernel 2.4.19)


get_UCSname is a memory allocation function. Should call
free_UCSname(&dname) to free the allocated memory

int jfs_link(struct dentry *old_dentry,
struct inode *dir, struct dentry *dentry)
{
....
---> if ((rc = get_UCSname(&dname, dentry, JFS_SBI(ip->i_sb)->nls_tab)))
goto out;

if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE)))
goto out;
....
out:
txEnd(tid);

up(&JFS_IP(dir)->commit_sem);
up(&JFS_IP(ip)->commit_sem);

jfs_info("jfs_link: rc:%d", rc);
return rc;
}