summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski.k@gmail.com>2015-07-09 15:19:29 +0200
committerMark Brown <broonie@kernel.org>2015-07-13 13:16:33 +0200
commit2dfbe9afcda3243dd309826cbbb8ae9e9f602006 (patch)
tree0c86bab57007a317e9d07558b00fb8c4b3edd4bb
parentASoC: zx: i2s: Fix devm_ioremap_resource return value check (diff)
downloadlinux-2dfbe9afcda3243dd309826cbbb8ae9e9f602006.tar.xz
linux-2dfbe9afcda3243dd309826cbbb8ae9e9f602006.zip
ASoC: zx: spdif: Fix devm_ioremap_resource return value check
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>
-rw-r--r--sound/soc/zte/zx296702-spdif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/zte/zx296702-spdif.c b/sound/soc/zte/zx296702-spdif.c
index 11a0e46a1156..26265ce4caca 100644
--- a/sound/soc/zte/zx296702-spdif.c
+++ b/sound/soc/zte/zx296702-spdif.c
@@ -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);