mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
9p: Fix memory leak in v9fs_mount
commit cb0aae0e31c632c407a2cab4307be85a001d4d98 upstream.
v9fs_mount
v9fs_session_init
v9fs_cache_session_get_cookie
v9fs_random_cachetag -->alloc cachetag
v9ses->fscache = fscache_acquire_cookie -->maybe NULL
sb = sget -->fail, goto clunk
clunk_fid:
v9fs_session_close
if (v9ses->fscache) -->NULL
kfree(v9ses->cachetag)
Thus memleak happens.
Link: http://lkml.kernel.org/r/[email protected]
Fixes: 60e78d2c99 ("9p: Add fscache support to 9p")
Cc: <[email protected]> # v2.6.32+
Signed-off-by: Zheng Bin <[email protected]>
Signed-off-by: Dominique Martinet <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
10de419977
commit
06d8ba5149
1 changed files with 2 additions and 3 deletions
|
|
@ -500,10 +500,9 @@ void v9fs_session_close(struct v9fs_session_info *v9ses)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_9P_FSCACHE
|
||||
if (v9ses->fscache) {
|
||||
if (v9ses->fscache)
|
||||
v9fs_cache_session_put_cookie(v9ses);
|
||||
kfree(v9ses->cachetag);
|
||||
}
|
||||
kfree(v9ses->cachetag);
|
||||
#endif
|
||||
kfree(v9ses->uname);
|
||||
kfree(v9ses->aname);
|
||||
|
|
|
|||
Loading…
Reference in a new issue