[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170821133616.22247-2-christian.brauner@ubuntu.com>
Date: Mon, 21 Aug 2017 15:36:16 +0200
From: Christian Brauner <christian.brauner@...ntu.com>
To: gregkh@...uxfoundation.org, arve@...roid.com,
riandrews@...roid.com, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Cc: Christian Brauner <christian.brauner@...ntu.com>
Subject: [PATCH 1/1] binder: free memory on error
Signed-off-by: Christian Brauner <christian.brauner@...ntu.com>
---
drivers/android/binder.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index f7665c31feca..41a11661eed7 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4215,7 +4215,7 @@ static int __init init_binder_device(const char *name)
static int __init binder_init(void)
{
int ret;
- char *device_name, *device_names;
+ char *device_name, *device_names, *device_tmp;
struct binder_device *device;
struct hlist_node *tmp;
@@ -4263,7 +4263,8 @@ static int __init binder_init(void)
}
strcpy(device_names, binder_devices_param);
- while ((device_name = strsep(&device_names, ","))) {
+ device_tmp = device_names;
+ while ((device_name = strsep(&device_tmp, ","))) {
ret = init_binder_device(device_name);
if (ret)
goto err_init_binder_device_failed;
@@ -4279,6 +4280,7 @@ static int __init binder_init(void)
}
err_alloc_device_names_failed:
debugfs_remove_recursive(binder_debugfs_dir_entry_root);
+ kfree(device_names);
return ret;
}
--
2.13.3
Powered by blists - more mailing lists