From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from va-1-115.ptr.blmpb.com (va-1-115.ptr.blmpb.com [209.127.230.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E622D1E5714 for ; Tue, 4 Aug 2026 12:20:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.230.115 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785846020; cv=none; b=S12HqeBBrevp6aQVVfk5MRckBD/7AimZ0o7kXb1TbidcZg0o8DkdiCykxpnG3fhn2mvOdxT/RLW/NR1hR3V8sy2Jr4c/btgowjg/ceiSgZB11XbZMCmtcKS38lCjgfRAdp0mOn6NqxxgoTmQzBZzGiaZXi0pRE1xmsQ1jKa8TGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785846020; c=relaxed/simple; bh=KSgJWK+VpI8rltL05ssW/EvkopF+w6LKVQcu1NrL1ec=; h=To:Subject:Mime-Version:Content-Type:Message-Id:References:Cc: From:Date:In-Reply-To; b=dzLXkKLX96TJHISKdlijAgC6kYnRFoqduNkguo1j3oRwIwXcIMEVZOrqcR8HBsJ4aDuxD+hR0ykB0aPORzh/TIK91OmowC+cqneVm2KoChWHQeiZflmFN/DjDRF1T7rpmFQ8oYImPUkc5qnsMUmFvLC1etzJRQEXWdHupf0R5n8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=jHio57Jh; arc=none smtp.client-ip=209.127.230.115 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="jHio57Jh" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1785846008; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=aevrnnfHbvyJZa4AXopRmIYISqXV7gyVfUIjKkBnHQc=; b=jHio57JhBm5BhMkdanHoclPBznOigD9cmSKXsMZ2Rd0WN3NEqL8k59KK6MvcJmMvJtBwZH /zNSYw3OYwxxuo5Rv2MmNXZMBRQg9X4kqsyxqeJepRoTQEGikZ7/DsqiHfBhjHamuIh7Nd aSmPy8x9WSl/MZzEEmZZEzr4tii7tge45AhYSNq4dC7n8DSYI4Zy/G/0EE0NHV3S9jojIH wvvFiHQrAUVyYNe5sjlWSbewYJWKT2kjYAZC9bkRJarfbQ0R51CWnUxyj7WRy0aQMfThUy CypfvhE3pgX/GyedR1kPst58ZUusHDy/6ro0TvS45elo39SIle44QI5EJjDe8Q== Content-Transfer-Encoding: 7bit To: "Thierry Reding" , "Jonathan Hunter" , Subject: [PATCH 1/2] soc/tegra: fuse: Return -ENODEV for unsupported legacy SoCs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Original-From: Jinhui Guo X-Mailer: git-send-email 2.17.1 Content-Type: text/plain; charset=UTF-8 Message-Id: <20260804121910.4961-2-guojinhui.liam@bytedance.com> References: <20260804121910.4961-1-guojinhui.liam@bytedance.com> Cc: , "Kartik Rajput" , "Jinhui Guo" From: "Jinhui Guo" Date: Tue, 4 Aug 2026 20:19:09 +0800 In-Reply-To: <20260804121910.4961-1-guojinhui.liam@bytedance.com> X-Lms-Return-Path: 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 --- 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