summaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/super.c b/fs/super.c
index 1f75fe312597..a5511c4ba69b 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1247,12 +1247,10 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
1247 struct dentry *root; 1247 struct dentry *root;
1248 struct super_block *sb; 1248 struct super_block *sb;
1249 int error = -ENOMEM; 1249 int error = -ENOMEM;
1250 struct security_mnt_opts opts; 1250 void *sec_opts = NULL;
1251
1252 security_init_mnt_opts(&opts);
1253 1251
1254 if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) { 1252 if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) {
1255 error = security_sb_eat_lsm_opts(data, &opts); 1253 error = security_sb_eat_lsm_opts(data, &sec_opts);
1256 if (error) 1254 if (error)
1257 return ERR_PTR(error); 1255 return ERR_PTR(error);
1258 } 1256 }
@@ -1275,7 +1273,7 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
1275 smp_wmb(); 1273 smp_wmb();
1276 sb->s_flags |= SB_BORN; 1274 sb->s_flags |= SB_BORN;
1277 1275
1278 error = security_sb_set_mnt_opts(sb, &opts, 0, NULL); 1276 error = security_sb_set_mnt_opts(sb, sec_opts, 0, NULL);
1279 if (error) 1277 if (error)
1280 goto out_sb; 1278 goto out_sb;
1281 1279
@@ -1295,13 +1293,13 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
1295 "negative value (%lld)\n", type->name, sb->s_maxbytes); 1293 "negative value (%lld)\n", type->name, sb->s_maxbytes);
1296 1294
1297 up_write(&sb->s_umount); 1295 up_write(&sb->s_umount);
1298 security_free_mnt_opts(&opts); 1296 security_free_mnt_opts(&sec_opts);
1299 return root; 1297 return root;
1300out_sb: 1298out_sb:
1301 dput(root); 1299 dput(root);
1302 deactivate_locked_super(sb); 1300 deactivate_locked_super(sb);
1303out_free_secdata: 1301out_free_secdata:
1304 security_free_mnt_opts(&opts); 1302 security_free_mnt_opts(&sec_opts);
1305 return ERR_PTR(error); 1303 return ERR_PTR(error);
1306} 1304}
1307 1305