summaryrefslogtreecommitdiffstats
path: root/drivers/android/binder.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2018-09-07 10:01:46 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-14 15:22:36 +0200
commit6b6642dadd685af885367d6e30f18553e2a23b22 (patch)
tree28c91e22b10961761eebdcbc4805022eb426e83a /drivers/android/binder.c
parent44d8047f1d87adc2fd7eccc88533794f6d88c15e (diff)
downloadlinux-6b6642dadd685af885367d6e30f18553e2a23b22.tar.bz2
android: binder: use kstrdup instead of open-coding it
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder.c')
-rw-r--r--drivers/android/binder.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 5410df2550dd..46dad7d724ac 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -5764,12 +5764,11 @@ static int __init binder_init(void)
* Copy the module_parameter string, because we don't want to
* 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) {
ret = -ENOMEM;
goto err_alloc_device_names_failed;
}
- strcpy(device_names, binder_devices_param);
device_tmp = device_names;
while ((device_name = strsep(&device_tmp, ","))) {