* [PATCH] soc: fsl: qe: Check of ioremap return value in qe_reset
@ 2022-06-11 11:49 Li Qiong
0 siblings, 0 replies; only message in thread
From: Li Qiong @ 2022-06-11 11:49 UTC (permalink / raw)
To: Qiang Zhao, Li Yang
Cc: renyu, yuzhe, linux-kernel, Li Qiong, linuxppc-dev, linux-arm-kernel
As the possible failure of the ioremap(), the qe_immr could be NULL.
Therefore it should be better to check it and print error message.
Signed-off-by: Li Qiong <liqiong@nfschina.com>
---
drivers/soc/fsl/qe/qe.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c
index b3c226eb5292..3c0948c2440e 100644
--- a/drivers/soc/fsl/qe/qe.c
+++ b/drivers/soc/fsl/qe/qe.c
@@ -88,6 +88,11 @@ void qe_reset(void)
if (qe_immr == NULL)
qe_immr = ioremap(get_qe_base(), QE_IMMAP_SIZE);
+ if (!qe_immr) {
+ pr_err("%s: failed to ioremap()\n", __func__);
+ return;
+ }
+
qe_snums_init();
qe_issue_cmd(QE_RESET, QE_CR_SUBBLOCK_INVALID,
--
2.11.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-13 11:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-11 11:49 [PATCH] soc: fsl: qe: Check of ioremap return value in qe_reset Li Qiong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).