The patch titled Subject: net/9p: detect invalid options as much as possible has been added to the -mm tree. Its filename is net-9p-detecting-invalid-options-as-much-as-possible.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/net-9p-detecting-invalid-options-as-much-as-possible.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/net-9p-detecting-invalid-options-as-much-as-possible.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Chengguang Xu <cgxu519@xxxxxxx> Subject: net/9p: detect invalid options as much as possible Currently when detecting invalid options in option parsing, some options(e.g. msize) just set errno and allow to continuously validate other options so that it can detect invalid options as much as possible and give proper error messages together. This patch applies same rule to option 'trans' and 'version' when detecting -EINVAL. Link: http://lkml.kernel.org/r/1525340676-34072-1-git-send-email-cgxu519@xxxxxxx Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Eric Van Hensbergen <ericvh@xxxxxxxxx> Cc: Ron Minnich <rminnich@xxxxxxxxxx> Cc: Latchesar Ionkov <lucho@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- net/9p/client.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff -puN net/9p/client.c~net-9p-detecting-invalid-options-as-much-as-possible net/9p/client.c --- a/net/9p/client.c~net-9p-detecting-invalid-options-as-much-as-possible +++ a/net/9p/client.c @@ -198,8 +198,6 @@ static int parse_opts(char *opts, struct pr_info("Could not find request transport: %s\n", s); ret = -EINVAL; - kfree(s); - goto free_and_return; } kfree(s); break; @@ -214,13 +212,12 @@ static int parse_opts(char *opts, struct "problem allocating copy of version arg\n"); goto free_and_return; } - ret = get_protocol_version(s); - if (ret == -EINVAL) { - kfree(s); - goto free_and_return; - } + r = get_protocol_version(s); + if (r < 0) + ret = r; + else + clnt->proto_version = r; kfree(s); - clnt->proto_version = ret; break; default: continue; _ Patches currently in -mm which might be from cgxu519@xxxxxxx are net-9p-detecting-invalid-options-as-much-as-possible.patch fs-9p-detecting-invalid-options-as-much-as-possible.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html