Skip to content

Commit

Permalink
... and the same for gadgetfs
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jan 9, 2012
1 parent 5b5f956 commit 87da5b3
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions drivers/usb/gadget/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,6 @@ static int
gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
{
struct inode *inode;
struct dentry *d;
struct dev_data *dev;

if (the_device)
Expand All @@ -2058,38 +2057,35 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
NULL, &simple_dir_operations,
S_IFDIR | S_IRUGO | S_IXUGO);
if (!inode)
goto enomem0;
goto Enomem;
inode->i_op = &simple_dir_inode_operations;
if (!(d = d_alloc_root (inode)))
goto enomem1;
sb->s_root = d;
if (!(sb->s_root = d_alloc_root (inode))) {
iput(inode);
goto Enomem;
}

/* the ep0 file is named after the controller we expect;
* user mode code can use it for sanity checks, like we do.
*/
dev = dev_new ();
if (!dev)
goto enomem2;
goto Enomem;

dev->sb = sb;
if (!gadgetfs_create_file (sb, CHIP,
dev, &dev_init_operations,
&dev->dentry))
goto enomem3;
&dev->dentry)) {
put_dev(dev);
goto Enomem;
}

/* other endpoint files are available after hardware setup,
* from binding to a controller.
*/
the_device = dev;
return 0;

enomem3:
put_dev (dev);
enomem2:
dput (d);
enomem1:
iput (inode);
enomem0:
Enomem:
return -ENOMEM;
}

Expand Down

0 comments on commit 87da5b3

Please sign in to comment.