remoteproc: imx_rproc: Fix an error handling path in 'imx_rproc_probe()'

If 'of_device_get_match_data()' fails, we must undo the previous
'rproc_alloc()' call.

Fixes: a0ff4aa6f0 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Christophe JAILLET 2018-03-14 20:56:37 +01:00 committed by Bjorn Andersson
parent 842891be96
commit de6f83f85b

View File

@ -339,8 +339,10 @@ static int imx_rproc_probe(struct platform_device *pdev)
}
dcfg = of_device_get_match_data(dev);
if (!dcfg)
return -EINVAL;
if (!dcfg) {
ret = -EINVAL;
goto err_put_rproc;
}
priv = rproc->priv;
priv->rproc = rproc;