From: Dan Carpenter Date: Mon, 26 Aug 2019 13:18:55 +0000 (+0300) Subject: ASoC: SOF: imx8: Fix an is IS_ERR() vs NULL check X-Git-Tag: v5.4-rc1~52^2~1^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a325c7bc3a92f1d5ba8cff10d7ab93a989cdeb80;p=platform%2Fkernel%2Flinux-rpi.git ASoC: SOF: imx8: Fix an is IS_ERR() vs NULL check The device_link_add() function only returns NULL on error, it doesn't return error pointers. Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support") Signed-off-by: Dan Carpenter Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20190826131855.GA6840@mwanda Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index c9d849c..2a22b18 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -227,8 +227,8 @@ static int imx8_probe(struct snd_sof_dev *sdev) DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE); - if (IS_ERR(priv->link[i])) { - ret = PTR_ERR(priv->link[i]); + if (!priv->link[i]) { + ret = -ENOMEM; dev_pm_domain_detach(priv->pd_dev[i], false); goto exit_unroll_pm; }