mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 07:29:42 -05:00
net/9p/client.c: fix potential refcnt problem of trans module
When specifying trans_mod multiple times in a mount, it will cause an inaccurate refcount of the trans module. Also, in the error case of option parsing, we should put the trans module if we have already got it. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Chengguang Xu <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: David Miller <[email protected]> Cc: Eric Van Hensbergen <[email protected]> Cc: Ron Minnich <[email protected]> Cc: Latchesar Ionkov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
7ff3c20468
commit
9421c3e641
1 changed files with 4 additions and 1 deletions
|
|
@ -190,7 +190,9 @@ static int parse_opts(char *opts, struct p9_client *clnt)
|
|||
p9_debug(P9_DEBUG_ERROR,
|
||||
"problem allocating copy of trans arg\n");
|
||||
goto free_and_return;
|
||||
}
|
||||
}
|
||||
|
||||
v9fs_put_trans(clnt->trans_mod);
|
||||
clnt->trans_mod = v9fs_get_trans_by_name(s);
|
||||
if (clnt->trans_mod == NULL) {
|
||||
pr_info("Could not find request transport: %s\n",
|
||||
|
|
@ -226,6 +228,7 @@ static int parse_opts(char *opts, struct p9_client *clnt)
|
|||
}
|
||||
|
||||
free_and_return:
|
||||
v9fs_put_trans(clnt->trans_mod);
|
||||
kfree(tmp_options);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue