diff options
| author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2018-09-07 04:01:46 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-14 09:22:36 -0400 |
| commit | 6b6642dadd685af885367d6e30f18553e2a23b22 (patch) | |
| tree | 28c91e22b10961761eebdcbc4805022eb426e83a /drivers/android | |
| parent | 44d8047f1d87adc2fd7eccc88533794f6d88c15e (diff) | |
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')
| -rw-r--r-- | drivers/android/binder.c | 3 |
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) | |||
| 5764 | * Copy the module_parameter string, because we don't want to | 5764 | * Copy the module_parameter string, because we don't want to |
| 5765 | * tokenize it in-place. | 5765 | * tokenize it in-place. |
| 5766 | */ | 5766 | */ |
| 5767 | device_names = kzalloc(strlen(binder_devices_param) + 1, GFP_KERNEL); | 5767 | device_names = kstrdup(binder_devices_param, GFP_KERNEL); |
| 5768 | if (!device_names) { | 5768 | if (!device_names) { |
| 5769 | ret = -ENOMEM; | 5769 | ret = -ENOMEM; |
| 5770 | goto err_alloc_device_names_failed; | 5770 | goto err_alloc_device_names_failed; |
| 5771 | } | 5771 | } |
| 5772 | strcpy(device_names, binder_devices_param); | ||
| 5773 | 5772 | ||
| 5774 | device_tmp = device_names; | 5773 | device_tmp = device_names; |
| 5775 | while ((device_name = strsep(&device_tmp, ","))) { | 5774 | while ((device_name = strsep(&device_tmp, ","))) { |
