summaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-01-10 23:48:52 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-10 23:48:52 +0100
commitb3f2a92447b8443360ac117a3d7c06689562a70c (patch)
treec30e40122be3140aeabdb27bb9960fbb9ed2e730 /fs/hfsplus/super.c
parentblock_dev: Suppress bdev_cache_init() kmemleak warninig (diff)
downloadlinux-b3f2a92447b8443360ac117a3d7c06689562a70c.tar.xz
linux-b3f2a92447b8443360ac117a3d7c06689562a70c.zip
hfsplus: creation of hidden dir on mount can fail
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hfsplus/super.c')
-rw-r--r--fs/hfsplus/super.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index edf0a801446b..427682ca9e48 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -499,9 +499,16 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
if (!sbi->hidden_dir) {
mutex_lock(&sbi->vh_mutex);
sbi->hidden_dir = hfsplus_new_inode(sb, S_IFDIR);
- hfsplus_create_cat(sbi->hidden_dir->i_ino, root, &str,
- sbi->hidden_dir);
+ if (!sbi->hidden_dir) {
+ mutex_unlock(&sbi->vh_mutex);
+ err = -ENOMEM;
+ goto out_put_root;
+ }
+ err = hfsplus_create_cat(sbi->hidden_dir->i_ino, root,
+ &str, sbi->hidden_dir);
mutex_unlock(&sbi->vh_mutex);
+ if (err)
+ goto out_put_hidden_dir;
hfsplus_mark_inode_dirty(sbi->hidden_dir,
HFSPLUS_I_CAT_DIRTY);