From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7EBA43E9FD; Tue, 21 Jul 2026 22:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784674322; cv=none; b=Wn04CyBDXJdkIvN/e7Mw2q027+UG2CSokVXFferNAaMexRicuwdxDzWsgD/GCN2wzyOoen5yB2ko58c82mSffg84GfMj7+VfXLZowKVGIHs48WTZMea8gpvToWl28E/aCcrY32nBBkWkK7TvZgThxuZpAMVSrp+ajkak8UhIsSU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784674322; c=relaxed/simple; bh=vKIqCCZSIqkYOBeSM+ixPFE08HojWZNstS4eUuowSaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HK6/FtTYaBdGJO8twhviipQPYgdkelcmT8qUTykdFPWBGcR2n7WY3N0vwYa9hhpzJS1DtSnqu2vMD2O70elOSiqqoAyC1v89xW2jGRs0Lfkgp3zGkMOyNYSRZdo79SRVfKJK2f2xEEKE+zJvnBNhC7v27PBGgYtV64SPTgWjpCk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rGRfn4Wh; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rGRfn4Wh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C091A1F00A3A; Tue, 21 Jul 2026 22:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784674321; bh=MV/fbVaxViP+s8vIWWkeW/hCTUZmbMHWf5nYwcIgUmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rGRfn4Wh2moZmoVlsZurHteqDpC52hYwlIgNuU7uAXAgS8XDpnHzEijfvBx3WAtAO OAkCDQcpCNz3bYgP8lCpuZ7IkYfhVxX/rsS80gDVqyhbO2Pl5NMKhP+lOftaRvNHEx XgCbEZ0CbjCh/m4Kv7HwUlltzp5uldLbCTa7VuCg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wang Jun <1742789905@qq.com>, "Christophe Leroy (CS GROUP)" Subject: [PATCH 5.10 454/699] soc: fsl: qe: panic on ioremap() failure in qe_reset() Date: Tue, 21 Jul 2026 17:23:33 +0200 Message-ID: <20260721152405.942013549@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152355.667394603@linuxfoundation.org> References: <20260721152355.667394603@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wang Jun <1742789905@qq.com> commit a0fe29d20e7822182e12324905af5115c1b3aed3 upstream. When ioremap() fails in qe_reset(), the global pointer qe_immr remains NULL, leading to a subsequent NULL pointer dereference when the pointer is accessed. Since this happens early in the boot process, a failure to map a few bytes of I/O memory indicates a fatal error from which the system cannot recover. Follow the same pattern as qe_sdma_init() and panic immediately when ioremap() fails. This avoids a silent NULL pointer dereference later and makes the error explicit. Fixes: 986585385131 ("[POWERPC] Add QUICC Engine (QE) infrastructure") Cc: stable@vger.kernel.org Signed-off-by: Wang Jun <1742789905@qq.com> Link: https://lore.kernel.org/r/tencent_FED49CF5331CC0C7910618883332A08E2606@qq.com [chleroy: Rearranged change to reduce churn] Signed-off-by: Christophe Leroy (CS GROUP) Signed-off-by: Greg Kroah-Hartman --- drivers/soc/fsl/qe/qe.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/soc/fsl/qe/qe.c +++ b/drivers/soc/fsl/qe/qe.c @@ -88,6 +88,9 @@ void qe_reset(void) if (qe_immr == NULL) qe_immr = ioremap(get_qe_base(), QE_IMMAP_SIZE); + if (!qe_immr) + panic("QE:ioremap failed!"); + qe_snums_init(); qe_issue_cmd(QE_RESET, QE_CR_SUBBLOCK_INVALID,