diff options
author | Krzysztof Kozlowski <k.kozlowski.k@gmail.com> | 2015-07-09 22:19:28 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-13 12:16:29 +0100 |
commit | a18da49ff3ec849c4584ae3abe2b83ff50705ace (patch) | |
tree | 6a0efb0d35375a97d8f7abdeeed610c1d3c04655 | |
parent | d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff) | |
download | op-kernel-dev-a18da49ff3ec849c4584ae3abe2b83ff50705ace.zip op-kernel-dev-a18da49ff3ec849c4584ae3abe2b83ff50705ace.tar.gz |
ASoC: zx: i2s: 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-i2s.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/zte/zx296702-i2s.c b/sound/soc/zte/zx296702-i2s.c index 98d96e1..1930c42 100644 --- a/sound/soc/zte/zx296702-i2s.c +++ b/sound/soc/zte/zx296702-i2s.c @@ -393,9 +393,9 @@ static int zx_i2s_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); zx_i2s->mapbase = res->start; zx_i2s->reg_base = devm_ioremap_resource(&pdev->dev, res); - if (!zx_i2s->reg_base) { + if (IS_ERR(zx_i2s->reg_base)) { dev_err(&pdev->dev, "ioremap failed!\n"); - return -EIO; + return PTR_ERR(zx_i2s->reg_base); } writel_relaxed(0, zx_i2s->reg_base + ZX_I2S_FIFO_CTRL); |