lkml.org 
[lkml]   [2008]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/8] omfs: add directory routines
From
Date
> +static int omfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
> +{
> + int err = 0;
> + struct inode *inode;
> +
> + mode |= S_IFDIR;
> +
> + inode = omfs_new_inode(dir, mode);
> + if (IS_ERR(inode))
> + return PTR_ERR(inode);
> +
> + if (dir->i_mode & S_ISGID) {
> + inode->i_gid = dir->i_gid;
> + if (S_ISDIR(mode))
> + inode->i_mode |= S_ISGID;
> + }
> +
> + err = omfs_make_empty(inode, dir->i_sb);
> + if (err)
> + goto out;
> +
> + err = omfs_add_link(dentry, inode);
> + if (err)
> + goto out;

These are leaking the inode reference.

There's more like these in the patch, please check all
omfs_new_inode() calls.

Miklos

> +
> + d_instantiate(dentry, inode);
> +out:
> + return err;
> +}



\
 
 \ /
  Last update: 2008-04-21 17:21    [W:0.066 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site