summaryrefslogtreecommitdiffstats
path: root/fs/coda/cnode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-01-10 10:46:03 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-10 11:13:13 -0500
commit0b2c4e39c014219ef73f05ab580c284bf8e6af0a (patch)
tree4447c0dbab25dc209f267c17123845b1d3bb8273 /fs/coda/cnode.c
parent3e25eb9c4bb649acdddb333d10774b640190f727 (diff)
downloadop-kernel-dev-0b2c4e39c014219ef73f05ab580c284bf8e6af0a.zip
op-kernel-dev-0b2c4e39c014219ef73f05ab580c284bf8e6af0a.tar.gz
coda: deal correctly with allocation failure from coda_cnode_makectl()
lookup should fail with ENOMEM, not silently make dentry negative. Switched to saner calling conventions, while we are at it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/coda/cnode.c')
-rw-r--r--fs/coda/cnode.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c
index 6475877..8af67c9 100644
--- a/fs/coda/cnode.c
+++ b/fs/coda/cnode.c
@@ -156,19 +156,16 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)
}
/* the CONTROL inode is made without asking attributes from Venus */
-int coda_cnode_makectl(struct inode **inode, struct super_block *sb)
+struct inode *coda_cnode_makectl(struct super_block *sb)
{
- int error = -ENOMEM;
-
- *inode = new_inode(sb);
- if (*inode) {
- (*inode)->i_ino = CTL_INO;
- (*inode)->i_op = &coda_ioctl_inode_operations;
- (*inode)->i_fop = &coda_ioctl_operations;
- (*inode)->i_mode = 0444;
- error = 0;
+ struct inode *inode = new_inode(sb);
+ if (inode) {
+ inode->i_ino = CTL_INO;
+ inode->i_op = &coda_ioctl_inode_operations;
+ inode->i_fop = &coda_ioctl_operations;
+ inode->i_mode = 0444;
+ return inode;
}
-
- return error;
+ return ERR_PTR(-ENOMEM);
}
OpenPOWER on IntegriCloud