staging: android: fix a possible memory leak
Memory allocated by kstrdup should be freed. CC: Brian Swetland <swetland@google.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Seunghun Lee <waydi1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
299ef8cd65
commit
eb29835fb3
|
@ -790,7 +790,7 @@ static int __init create_log(char *log_name, int size)
|
||||||
if (unlikely(ret)) {
|
if (unlikely(ret)) {
|
||||||
pr_err("failed to register misc device for log '%s'!\n",
|
pr_err("failed to register misc device for log '%s'!\n",
|
||||||
log->misc.name);
|
log->misc.name);
|
||||||
goto out_free_log;
|
goto out_free_misc_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("created %luK log '%s'\n",
|
pr_info("created %luK log '%s'\n",
|
||||||
|
@ -798,6 +798,9 @@ static int __init create_log(char *log_name, int size)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
out_free_misc_name:
|
||||||
|
kfree(log->misc.name);
|
||||||
|
|
||||||
out_free_log:
|
out_free_log:
|
||||||
kfree(log);
|
kfree(log);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue