[PATCH] fs: avoid setting root or rootopts to literal string "<NULL>"

Sascha Hauer s.hauer at pengutronix.de
Mon Apr 20 00:45:09 PDT 2026


On Fri, Apr 17, 2026 at 10:44:14AM +0200, Sascha Hauer wrote:
> 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 at 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;

This can't work. I said in the commit message dev_get_param returns a
literal "<NULL>" string, so testing for non NULL here makes no
difference.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list