mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fs: avoid setting root or rootopts to literal string "<NULL>"
@ 2026-04-17  8:44 Sascha Hauer
  2026-04-20  7:45 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2026-04-17  8:44 UTC (permalink / raw)
  To: Barebox List; +Cc: Alexander Shiyan

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-20  7:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-17  8:44 [PATCH] fs: avoid setting root or rootopts to literal string "<NULL>" Sascha Hauer
2026-04-20  7:45 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox