ASoC: SOF: imx8: fix memory allocation failure check on priv->pd_dev
authorColin Ian King <colin.king@canonical.com>
Wed, 4 Dec 2019 12:48:16 +0000 (12:48 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 24 Dec 2019 23:56:13 +0000 (23:56 +0000)
The memory allocation failure check for priv->pd_dev is incorrectly
pointer checking priv instead of priv->pd_dev. Fix this.

Addresses-Coverity: ("Logically dead code")
Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191204124816.1415359-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/imx/imx8.c

index cfefcfd927986d537fd59476c1a1f479f4d5003c..9d926b1df0d7771ad5bd19e194b62a8625856ede 100644 (file)
@@ -209,7 +209,7 @@ static int imx8_probe(struct snd_sof_dev *sdev)
 
        priv->pd_dev = devm_kmalloc_array(&pdev->dev, priv->num_domains,
                                          sizeof(*priv->pd_dev), GFP_KERNEL);
-       if (!priv)
+       if (!priv->pd_dev)
                return -ENOMEM;
 
        priv->link = devm_kmalloc_array(&pdev->dev, priv->num_domains,