the final strsep() sets opts to NULL so kfree() becomes no-op.
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I18a0d3556fa2932c217d9e705af9e5b5720a364b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54554
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
static int ll_options(char *options, struct super_block *sb)
{
struct ll_sb_info *sbi = ll_s2sbi(sb);
- char *s2, *s1, *opts;
+ char *s2, *s1, *opts, *orig_opts;
int err = 0;
ENTRY;
RETURN(0);
/* Don't stomp on lmd_opts */
- opts = kstrdup(options, GFP_KERNEL);
+ orig_opts = opts = kstrdup(options, GFP_KERNEL);
if (!opts)
RETURN(-ENOMEM);
s1 = opts;
break;
}
}
- kfree(opts);
+ kfree(orig_opts);
RETURN(err);
}