Commit 6b6642da authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Greg Kroah-Hartman

android: binder: use kstrdup instead of open-coding it

Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 44d8047f
...@@ -5764,12 +5764,11 @@ static int __init binder_init(void) ...@@ -5764,12 +5764,11 @@ static int __init binder_init(void)
* Copy the module_parameter string, because we don't want to * Copy the module_parameter string, because we don't want to
* tokenize it in-place. * tokenize it in-place.
*/ */
device_names = kzalloc(strlen(binder_devices_param) + 1, GFP_KERNEL); device_names = kstrdup(binder_devices_param, GFP_KERNEL);
if (!device_names) { if (!device_names) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_alloc_device_names_failed; goto err_alloc_device_names_failed;
} }
strcpy(device_names, binder_devices_param);
device_tmp = device_names; device_tmp = device_names;
while ((device_name = strsep(&device_tmp, ","))) { while ((device_name = strsep(&device_tmp, ","))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment