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/btrfs/super.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'fs/btrfs') diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index b362b45dd757..6fc8e963ad44 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1461,20 +1461,7 @@ out: static int parse_security_options(char *orig_opts, struct security_mnt_opts *sec_opts) { - char *secdata = NULL; - int ret = 0; - - secdata = alloc_secdata(); - if (!secdata) - return -ENOMEM; - ret = security_sb_copy_data(orig_opts, secdata); - if (ret) { - free_secdata(secdata); - return ret; - } - ret = security_sb_parse_opts_str(secdata, sec_opts); - free_secdata(secdata); - return ret; + return security_sb_eat_lsm_opts(orig_opts, sec_opts); } static int setup_security_options(struct btrfs_fs_info *fs_info, -- cgit v1.2.3