[alsa-devel] [PATCH -next] ASoC: sprd: Fix return value check in sprd_mcdt_probe()
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().
Fixes: d7bff893e04f ("ASoC: sprd: Add Spreadtrum multi-channel data transfer support") Signed-off-by: Wei Yongjun weiyongjun1@huawei.com --- sound/soc/sprd/sprd-mcdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sprd/sprd-mcdt.c b/sound/soc/sprd/sprd-mcdt.c index 28f5e649733d..e9318d7a4810 100644 --- a/sound/soc/sprd/sprd-mcdt.c +++ b/sound/soc/sprd/sprd-mcdt.c @@ -951,8 +951,8 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mcdt->base = devm_ioremap_resource(&pdev->dev, res); - if (!mcdt->base) - return -ENOMEM; + if (IS_ERR(mcdt->base)) + return PTR_ERR(mcdt->base);
mcdt->dev = &pdev->dev; spin_lock_init(&mcdt->lock);
On Mon, 29 Apr 2019 at 20:15, Wei Yongjun weiyongjun1@huawei.com wrote:
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().
Fixes: d7bff893e04f ("ASoC: sprd: Add Spreadtrum multi-channel data transfer support") Signed-off-by: Wei Yongjun weiyongjun1@huawei.com
Thanks for fixing my mistake. Reviewed-by: Baolin Wang baolin.wang@linaro.org
sound/soc/sprd/sprd-mcdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sprd/sprd-mcdt.c b/sound/soc/sprd/sprd-mcdt.c index 28f5e649733d..e9318d7a4810 100644 --- a/sound/soc/sprd/sprd-mcdt.c +++ b/sound/soc/sprd/sprd-mcdt.c @@ -951,8 +951,8 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mcdt->base = devm_ioremap_resource(&pdev->dev, res);
if (!mcdt->base)
return -ENOMEM;
if (IS_ERR(mcdt->base))
return PTR_ERR(mcdt->base); mcdt->dev = &pdev->dev; spin_lock_init(&mcdt->lock);
The patch
ASoC: sprd: Fix return value check in sprd_mcdt_probe()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 7c88b92816dfe5eab224b96577b50ac00b4be68a Mon Sep 17 00:00:00 2001
From: Wei Yongjun weiyongjun1@huawei.com Date: Mon, 29 Apr 2019 12:25:12 +0000 Subject: [PATCH] ASoC: sprd: Fix return value check in sprd_mcdt_probe()
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().
Fixes: d7bff893e04f ("ASoC: sprd: Add Spreadtrum multi-channel data transfer support") Signed-off-by: Wei Yongjun weiyongjun1@huawei.com Reviewed-by: Baolin Wang baolin.wang@linaro.org Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/sprd/sprd-mcdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sprd/sprd-mcdt.c b/sound/soc/sprd/sprd-mcdt.c index 28f5e649733d..e9318d7a4810 100644 --- a/sound/soc/sprd/sprd-mcdt.c +++ b/sound/soc/sprd/sprd-mcdt.c @@ -951,8 +951,8 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mcdt->base = devm_ioremap_resource(&pdev->dev, res); - if (!mcdt->base) - return -ENOMEM; + if (IS_ERR(mcdt->base)) + return PTR_ERR(mcdt->base);
mcdt->dev = &pdev->dev; spin_lock_init(&mcdt->lock);
participants (3)
-
Baolin Wang
-
Mark Brown
-
Wei Yongjun