From: Wei Yongjun Date: Fri, 25 Oct 2013 09:06:24 +0000 (+0800) Subject: ASoC: samsung: fix return value check in i2s_alloc_dai() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=29ca9c73e54131c9ad90c5381f368d9b09b5aca4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ASoC: samsung: fix return value check in i2s_alloc_dai() In case of error, the function platform_device_alloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown --- diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 32956df8f50c..2e031fa729f0 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1073,7 +1073,7 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) dev_set_drvdata(&i2s->pdev->dev, i2s); } else { /* Create a new platform_device for Secondary */ i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1); - if (IS_ERR(i2s->pdev)) + if (!i2s->pdev) return NULL; i2s->pdev->dev.parent = &pdev->dev;