From f5c0c26d9008b355babb6d16f3d7c4de3bada0e7 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 17 Nov 2018 12:09:18 -0500 Subject: new helper: security_sb_eat_lsm_opts() combination of alloc_secdata(), security_sb_copy_data(), security_sb_parse_opt_str() and free_secdata(). Reviewed-by: David Howells Signed-off-by: Al Viro --- fs/super.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'fs/super.c') diff --git a/fs/super.c b/fs/super.c index 8d9c9199832d..d571527cb8b8 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1252,18 +1252,7 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data) security_init_mnt_opts(&opts); if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) { - char *secdata = alloc_secdata(); - if (!secdata) - return ERR_PTR(-ENOMEM); - - error = security_sb_copy_data(data, secdata); - if (error) { - free_secdata(secdata); - return ERR_PTR(error); - } - - error = security_sb_parse_opts_str(secdata, &opts); - free_secdata(secdata); + error = security_sb_eat_lsm_opts(data, &opts); if (error) return ERR_PTR(error); } -- cgit v1.2.3-59-g8ed1b