From 6b6642dadd685af885367d6e30f18553e2a23b22 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 7 Sep 2018 10:01:46 +0200 Subject: android: binder: use kstrdup instead of open-coding it Signed-off-by: Rasmus Villemoes Signed-off-by: Greg Kroah-Hartman --- drivers/android/binder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/android') 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, ","))) { -- cgit