1
0
Fork 0

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 <alice.guo@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Alice Guo 2020-06-16 21:07:04 +08:00
parent 029bc3d1e4
commit b1a763a71e
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}