Skip to contentSkip to conversation

dyndbg-replace-kstrdup-strchr-with-kstrdup_and_replace.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Mar 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: dyndbg: replace kstrdup() + strchr() with kstrdup_and_replace()
has been removed from the -mm tree. Its filename was
dyndbg-replace-kstrdup-strchr-with-kstrdup_and_replace.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Andy Shevchenko <[email protected]>
Subject: dyndbg: replace kstrdup() + strchr() with kstrdup_and_replace()
Date: Tue, 13 Feb 2024 18:27:41 +0200

Replace open coded functionalify of kstrdup_and_replace() with a call.

---

 lib/dynamic_debug.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
lib/dynamic_debug.c renamed from lib/dynamic_debug.c~dyndbg-replace-kstrdup-strchr-with-kstrdup_and_replace +3 -4
@@ -640,10 +640,9 @@ static int param_set_dyndbg_classnames(c
 	int cls_id, totct = 0;
 	bool wanted;
 
-	cl_str = tmp = kstrdup(instr, GFP_KERNEL);
-	p = strchr(cl_str, '\n');
-	if (p)
-		*p = '\0';
+	cl_str = tmp = kstrdup_and_replace(instr, '\n', '\0', GFP_KERNEL);
+	if (!tmp)
+		return -ENOMEM;
 
 	/* start with previously set state-bits, then modify */
 	curr_bits = old_bits = *dcp->bits;

_

Patches currently in -mm which might be from [email protected] are