Re: [PATCH 4/8] omfs: add directory routines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +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;
> +}

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux