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

From: Miklos Szeredi
Date: Mon Apr 21 2008 - 11:18:42 EST


> +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-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/