With lmd_parse() rework being based on the llite match_table work
it inherited the same memory leak. Save the opts pointer to be
used bu kfree at the end.
Fixes:
415fa27540 ("LU-9325 obdclass: use match_table for server mount options")
Test-Parameters: trivial
Change-Id: I016f39f1512118486a0dc119ab075a1408b2a709
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54650
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
*/
int lmd_parse(char *options, struct lustre_mount_data *lmd)
{
*/
int lmd_parse(char *options, struct lustre_mount_data *lmd)
{
- char *s1, *s2, *opts, *devname = NULL;
+ char *s1, *s2, *opts, *orig_opts, *devname = NULL;
struct lustre_mount_data *raw = (struct lustre_mount_data *)options;
int rc = 0;
struct lustre_mount_data *raw = (struct lustre_mount_data *)options;
int rc = 0;
opts = kstrdup(options, GFP_KERNEL);
if (!opts)
RETURN(-ENOMEM);
opts = kstrdup(options, GFP_KERNEL);
if (!opts)
RETURN(-ENOMEM);
s1 = opts;
OBD_ALLOC(lmd->lmd_params, LMD_PARAMS_MAXLEN);
s1 = opts;
OBD_ALLOC(lmd->lmd_params, LMD_PARAMS_MAXLEN);
invalid:
if (rc < 0)
CERROR("Bad mount options %s\n", options);
invalid:
if (rc < 0)
CERROR("Bad mount options %s\n", options);