From: Enlin Mu <enlin.mu@linux.dev>
To: robh@kernel.org, saravanak@google.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
enlin.mu@unisoc.com, enlin.mu@linux.dev
Subject: [PATCH] of: print warning when cmdline overflows from bootargs
Date: Wed, 5 Nov 2025 16:27:17 +0800 [thread overview]
Message-ID: <20251105082717.4040-1-enlin.mu@linux.dev> (raw)
From: Enlin Mu <enlin.mu@uisoc.com>
add debug info. sometimes cmdline in dts is too long,
developers are not aware of the length limit of the
cmdline, resulting in some misjudgments.
Signed-off-by: Enlin Mu <enlin.mu@uisoc.com>
---
drivers/of/fdt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 0edd639898a6..077799b2f565 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1085,6 +1085,8 @@ int __init early_init_dt_scan_chosen(char *cmdline)
p = of_get_flat_dt_prop(node, "bootargs", &l);
if (p != NULL && l > 0)
strscpy(cmdline, p, min(l, COMMAND_LINE_SIZE));
+ if (l > COMMAND_LINE_SIZE)
+ pr_warn("cmdline overflows from bootargs\n");
handle_cmdline:
/*
--
2.39.5
next reply other threads:[~2025-11-05 8:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 8:27 Enlin Mu [this message]
2025-11-06 8:55 ` [PATCH] of: print warning when cmdline overflows from bootargs Krzysztof Kozlowski
2025-11-06 9:17 ` Conor Dooley
2025-12-02 2:17 ` enlin.mu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251105082717.4040-1-enlin.mu@linux.dev \
--to=enlin.mu@linux.dev \
--cc=devicetree@vger.kernel.org \
--cc=enlin.mu@unisoc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.