cred fix error handling
PATCH 1/1 cred fix error handling
Causes memory leak on OO mem condition.
Signed-off-by Mathieu Desnoyers <[email protected]>
CC David Howells <[email protected]>
--- kernel/cred.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/cred.c +5 -1
@@ -364,7 +364,7 @@ struct cred *prepare_usermodehelper_cred new =kmem_cache_alloc (cred_jar,GFP_ATOMIC );if (!new) -return NULL ; + goto free_tgcred;kdebug ("prepare_usermodehelper_creds() alloc %p" , new);
@@ -397,6 +397,10 @@ struct cred *prepare_usermodehelper_cred error:put_cred (new); +free_tgcred: +#ifdef CONFIG_KEYS +kfree (tgcred ); +#endif return NULL ; }
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com