diff options
| author | Wei Yongjun <weiyongjun1@huawei.com> | 2019-08-26 08:00:03 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2019-08-27 14:21:54 -0400 |
| commit | 393151c211006cc5ac6af26ecd9982dd916a8104 (patch) | |
| tree | 4cf1a2b8ccbb542ee1d6f75d736fb710fd10afa0 /sound/soc/sof | |
| parent | 3cdc3c9fd9fa92bcef777512d9f4eef854f9a4ed (diff) | |
ASoC: SOF: imx8: Fix return value check in imx8_probe()
In case of error, the function devm_ioremap_wc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20190826120003.183279-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof')
| -rw-r--r-- | sound/soc/sof/imx/imx8.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index 640472491037..c9d849ced54a 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c | |||
| @@ -296,10 +296,10 @@ static int imx8_probe(struct snd_sof_dev *sdev) | |||
| 296 | sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap_wc(sdev->dev, res.start, | 296 | sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap_wc(sdev->dev, res.start, |
| 297 | res.end - res.start + | 297 | res.end - res.start + |
| 298 | 1); | 298 | 1); |
| 299 | if (IS_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM])) { | 299 | if (!sdev->bar[SOF_FW_BLK_TYPE_SRAM]) { |
| 300 | dev_err(sdev->dev, "failed to ioremap mem 0x%x size 0x%x\n", | 300 | dev_err(sdev->dev, "failed to ioremap mem 0x%x size 0x%x\n", |
| 301 | base, size); | 301 | base, size); |
| 302 | ret = PTR_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM]); | 302 | ret = -ENOMEM; |
| 303 | goto exit_pdev_unregister; | 303 | goto exit_pdev_unregister; |
| 304 | } | 304 | } |
| 305 | sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM; | 305 | sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM; |
