soc: fsl: guts: machine variable might be unset
authorMichael Walle <michael@walle.cc>
Mon, 4 Apr 2022 09:56:03 +0000 (11:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:08 +0000 (14:23 +0200)
[ Upstream commit ab3f045774f704c4e7b6a878102f4e9d4ae7bc74 ]

If both the model and the compatible properties are missing, then
machine will not be set. Initialize it with NULL.

Fixes: 34c1c21e94ac ("soc: fsl: fix section mismatch build warnings")
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/fsl/guts.c

index 75eabfb..0b2c7fd 100644 (file)
@@ -141,7 +141,7 @@ static int fsl_guts_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct resource *res;
        const struct fsl_soc_die_attr *soc_die;
-       const char *machine;
+       const char *machine = NULL;
        u32 svr;
 
        /* Initialize guts */