Skip to content

Commit

Permalink
ASoC: SOF: imx8: fix memory allocation failure check on priv->pd_dev
Browse files Browse the repository at this point in the history
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: 202acc5 ("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>
  • Loading branch information
Colin Ian King authored and Mark Brown committed Dec 24, 2019
1 parent 921162c commit 98910e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/sof/imx/imx8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 98910e1

Please sign in to comment.