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: 202acc565a ("ASoC: SOF: imx: Add i.MX8 HW support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20190826131855.GA6840@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Dan Carpenter 2019-08-26 16:18:55 +03:00 committed by Mark Brown
parent 9ec05d4723
commit a325c7bc3a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 2 deletions

View File

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