From b1a763a71e37574d325b24c73b12364760c98544 Mon Sep 17 00:00:00 2001 From: Alice Guo Date: Tue, 16 Jun 2020 21:07:04 +0800 Subject: [PATCH] MLK-24326: remoteproc: imx_rproc: fix "Dereference after null check" problem Before dereferencing fw, need to judge whether fw is a null pointer. Signed-off-by: Alice Guo --- drivers/remoteproc/imx_rproc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 831e67dc0862..331737e239a2 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -582,8 +582,11 @@ static int imx_rproc_elf_load_segments(struct rproc *rproc, { struct imx_rproc *priv = rproc->priv; - if (!priv->early_boot) + if (!priv->early_boot) { + if (!fw) + return -EINVAL; return rproc_elf_load_segments(rproc, fw); + } return 0; }