mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
UPSTREAM: android: binder: use kstrdup instead of open-coding it
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Bug: 136497735
Change-Id: I545073facdb76ea12accfc7bfa4738f2e3bf0b28
(cherry picked from commit 6b6642dadd)
Signed-off-by: Hridya Valsaraju <hridya@google.com>
This commit is contained in:
committed by
Hridya Valsaraju
parent
8d0719a920
commit
760b8036e6
@@ -6133,12 +6133,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, ","))) {
|
||||
|
||||
Reference in New Issue
Block a user