memory leak in devpts in 2.4.x
PATCH 1/1 memory leak in devpts in 2.4.x
small memory leak in devpts_read_super() on error path.
Kirill
fs/devpts/inode.c renamed from fs/devpts/inode.c.dpts +4 -2
@@ -143,12 +143,12 @@ struct super_block *devpts_read_super(stif (devpts_parse_options (data,sbi) && !silent) {printk ("devpts: called with bogus options\n" ); - goto fail_free; + goto fail_inode; } inode =new_inode (s);if (!inode) - goto fail_free; + goto fail_inode; inode->i_ino =1 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; inode->i_blocks =0 ;
@@ -170,6 +170,8 @@ struct super_block *devpts_read_super(stprintk ("devpts: get root dentry failed\n" );iput (inode); +fail_inode: +kfree (sbi->inodes); fail_free:kfree (sbi); fail:
PATCH 1/1 memory access to free memory in 2.4.x
memory access to files which are already put.
Kirill
fs/proc/base.c renamed from fs/proc/base.c.saved +1 -1
@@ -825,8 +825,8 @@return NULL ; out_unlock2: -put_files_struct (files);read_unlock (&files->file_lock); +put_files_struct (files); out_unlock:iput (inode); out: