From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH] fs: avoid setting root or rootopts to literal string "<NULL>"
Date: Fri, 17 Apr 2026 10:44:14 +0200 [thread overview]
Message-ID: <20260417084414.137087-1-s.hauer@pengutronix.de> (raw)
linux.bootargs.root and linux.bootards.rootopts might be unspecified in
which case dev_get_param() returns a literal "<NULL>" string. Avoid
setting root and rootopts to that string.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
fs/fs.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/fs.c b/fs/fs.c
index 6a73a5baa2..0c53881a92 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1251,8 +1251,14 @@ void fsdev_get_linux_root_options(struct fs_device *fsdev,
const char **root, const char **rootopts)
{
if (fsdev) {
- *root = dev_get_param(&fsdev->dev, "linux.bootargs.root");
- *rootopts = dev_get_param(&fsdev->dev, "linux.bootargs.rootopts");
+ const char *s;
+
+ s = dev_get_param(&fsdev->dev, "linux.bootargs.root");
+ if (s)
+ *root = s;
+ s = dev_get_param(&fsdev->dev, "linux.bootargs.rootopts");
+ if (s)
+ *rootopts = s;
}
}
--
2.47.3
next reply other threads:[~2026-04-17 8:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 8:44 Sascha Hauer [this message]
2026-04-20 7:45 ` Sascha Hauer
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=20260417084414.137087-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=eagle.alexander923@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox