[PATCH 1/2] soc/tegra: fuse: Return -ENODEV for unsupported legacy SoCs
"Jinhui Guo" <[email protected]> Tue, 4 Aug 2026 20:19:09 +0800
| Newsgroups | org.kernel.vger.linux-tegra,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
When booting without a FUSE device tree node, tegra_init_fuse() falls
back to legacy SoC detection on 32-bit ARM systems. If the detected chip
ID does not match any supported SoC, the default case only prints a
warning and breaks out of the switch statement.
In that case fuse->soc remains NULL, but initialization continues and
later calls fuse->soc->init(fuse), which results in a NULL pointer
dereference.
Return -ENODEV from the default case to stop initialization immediately
when the legacy fallback detects an unsupported SoC.
Fixes: 7e939de1b2bb ("soc/tegra: fuse: Unify Tegra20 and Tegra30 drivers")
Signed-off-by: Jinhui Guo <[email protected]>
---
drivers/soc/tegra/fuse/fuse-tegra.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index 78b054d43a42..e539e6b595b0 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -520,7 +520,7 @@ static int __init tegra_init_fuse(void)
default:
pr_warn("Unsupported SoC: %02x\n", chip);
- break;
+ return -ENODEV;
}
} else {
/*
--
2.20.1