diff options
author | Seunghun Lee <waydi1@gmail.com> | 2014-08-14 02:02:48 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-17 07:15:10 -0700 |
commit | eb29835fb3ae9f7a8c8a4ae92e192052c3473557 (patch) | |
tree | e7c1d29373e8b75c681ae843317dc1c3360016ab /drivers/staging/android | |
parent | 299ef8cd6556d9cd968f672ad30c6df4cfcfc729 (diff) | |
download | linux-stable-eb29835fb3ae9f7a8c8a4ae92e192052c3473557.tar.gz linux-stable-eb29835fb3ae9f7a8c8a4ae92e192052c3473557.tar.bz2 linux-stable-eb29835fb3ae9f7a8c8a4ae92e192052c3473557.zip |
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>
Diffstat (limited to 'drivers/staging/android')
-rw-r--r-- | drivers/staging/android/logger.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c index 9b47e66599a3..0bf0d24d12d5 100644 --- a/drivers/staging/android/logger.c +++ b/drivers/staging/android/logger.c @@ -790,7 +790,7 @@ static int __init create_log(char *log_name, int size) if (unlikely(ret)) { pr_err("failed to register misc device for log '%s'!\n", log->misc.name); - goto out_free_log; + goto out_free_misc_name; } pr_info("created %luK log '%s'\n", @@ -798,6 +798,9 @@ static int __init create_log(char *log_name, int size) return 0; +out_free_misc_name: + kfree(log->misc.name); + out_free_log: kfree(log); |