Skip to contentSkip to conversation

mm-cma-replace-snprintf-with-strscpy-in-cma_new_area.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Feb 6

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/cma: replace snprintf with strscpy in cma_new_area
has been removed from the -mm tree. Its filename was
mm-cma-replace-snprintf-with-strscpy-in-cma_new_area.patch

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

------------------------------------------------------
From: Thorsten Blum <[email protected]>
Subject: mm/cma: replace snprintf with strscpy in cma_new_area
Date: Mon, 26 Jan 2026 18:45:15 +0100

Replace snprintf("%s", ...) with the faster and more direct strscpy().

---

 mm/cma.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/cma.c renamed from mm/cma.c~mm-cma-replace-snprintf-with-strscpy-in-cma_new_area +2 -1
@@ -22,6 +22,7 @@
 #include <linux/mm.h>
 #include <linux/sizes.h>
 #include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/string_choices.h>
 #include <linux/log2.h>
 #include <linux/cma.h>
@@ -233,7 +234,7 @@ static int __init cma_new_area(const cha
 	cma_area_count++;
 
 	if (name)
-		snprintf(cma->name, CMA_MAX_NAME, "%s", name);
+		strscpy(cma->name, name);
 	else
 		snprintf(cma->name, CMA_MAX_NAME,  "cma%d\n", cma_area_count);
 

_

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