[PATCH linux-next] profiling: keep the error message in the mm-nonmm-unstable merge

From: Sasha Levin

Date: Mon Nov 16 2026 - 16:42:24 EST


Commit 944b8062bc6f ("profiling: report it when /proc/profile can't be
created") in the vfs-brauner-fixes tree and commit 091be6dce28a
("perf/profile: report failure to create /proc/profile") in the
mm-nonmm-unstable tree both make create_proc_profile() return -ENOMEM
when proc_create() fails. The second one also prints an error, as the
return value of an initcall is not shown to anyone. The merge resolution
took the first version, so the message is gone.

Keep the pr_err().

Fixes: ac8dc2166a3c ("Merge branch 'mm-nonmm-unstable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm";)
Link: https://lore.kernel.org/all/avsnCFn0jCvbhtRw@xxxxxxxxxxxxx/
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
To be folded into the mm-nonmm-unstable merge, ac8dc2166a3c in next-20261116.

kernel/profile.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/profile.c b/kernel/profile.c
index c6d5a2638a52e..818098cc094a5 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -245,8 +245,10 @@ int __ref create_proc_profile(void)
return 0;
entry = proc_create("profile", S_IWUSR | S_IRUGO,
NULL, &profile_proc_ops);
- if (!entry)
+ if (!entry) {
+ pr_err("profile: failed to create /proc/profile\n");
return -ENOMEM;
+ }
proc_set_size(entry, (1 + prof_len) * sizeof(atomic_t));
return 0;
}

base-commit: 749a4de370409464cf8501ec5b2451df45c84eb4
--
2.53.0