X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fmount_lustre.c;h=b2c742b8477e6bcbb0ffb9add2e97db53a9dcccf;hb=refs%2Fchanges%2F00%2F31400%2F3;hp=fbfb1a00fc05e04b9b9211c74cc6e363bc12992a;hpb=a34ba90453b8bb8de9bcdf949f8afc4c2a43f393;p=fs%2Flustre-release.git diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index fbfb1a0..b2c742b 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -285,6 +285,9 @@ int parse_options(struct mount_opts *mop, char *orig_options, int rc = 0; options = calloc(strlen(orig_options) + 1, 1); + if (options == NULL) + return ENOMEM; + *flagp = 0; nextopt = orig_options; while ((opt = strsep(&nextopt, ","))) { @@ -292,8 +295,7 @@ int parse_options(struct mount_opts *mop, char *orig_options, /* empty option */ continue; - /* Handle retries in a slightly different - * manner */ + /* Handle retries in a slightly different manner */ arg = opt; val = strchr(opt, '='); /* please note that some ldiskfs mount options are also in @@ -330,7 +332,7 @@ int parse_options(struct mount_opts *mop, char *orig_options, "%s: shared key path too long\n", progname); free(options); - return -1; + return EINVAL; } strncpy(mop->mo_skpath, val + 1, strlen(val + 1)); #endif @@ -805,7 +807,6 @@ int main(int argc, char *const argv[]) if (rc) { fprintf(stderr, "%s: can't parse options: %s\n", progname, options); - rc = EINVAL; goto out_options; }