public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] android: binder: use kstrdup instead of open-coding it
@ 2018-09-07  8:01 Rasmus Villemoes
  2018-09-07  8:08 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Rasmus Villemoes @ 2018-09-07  8:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen
  Cc: Rasmus Villemoes, devel, linux-kernel

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/android/binder.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index d58763b6b009..2abcf4501d9a 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -5667,12 +5667,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, ","))) {
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-07  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-07  8:01 [PATCH] android: binder: use kstrdup instead of open-coding it Rasmus Villemoes
2018-09-07  8:08 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox