Skip to content

Commit

Permalink
android: binder: use kstrdup instead of open-coding it
Browse files Browse the repository at this point in the history
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Villemoes authored and gregkh committed Sep 14, 2018
1 parent 44d8047 commit 6b6642d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, ","))) {
Expand Down

0 comments on commit 6b6642d

Please sign in to comment.