Messages in this thread | | | Subject | Re: [PATCH 4/8] omfs: add directory routines | From | Miklos Szeredi <> | Date | Mon, 21 Apr 2008 17:18:18 +0200 |
| |
> +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; > +}
| |