Skip to content

Commit

Permalink
ASoC: zx: spdif: Fix devm_ioremap_resource return value check
Browse files Browse the repository at this point in the history
Value returned by devm_ioremap_resource() was checked for non-NULL but
devm_ioremap_resource() returns IOMEM_ERR_PTR, not NULL. In case of
error this could lead to dereference of ERR_PTR.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Reviewed-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Krzysztof Kozlowski authored and Mark Brown committed Jul 13, 2015
1 parent a18da49 commit 2dfbe9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/zte/zx296702-spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ static int zx_spdif_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
zx_spdif->mapbase = res->start;
zx_spdif->reg_base = devm_ioremap_resource(&pdev->dev, res);
if (!zx_spdif->reg_base) {
if (IS_ERR(zx_spdif->reg_base)) {
dev_err(&pdev->dev, "ioremap failed!\n");
return -EIO;
return PTR_ERR(zx_spdif->reg_base);
}

zx_spdif_dev_init(zx_spdif->reg_base);
Expand Down

0 comments on commit 2dfbe9a

Please sign in to comment.