Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29ca9c73 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown
Browse files

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent de0022d4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1073,7 +1073,7 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
		dev_set_drvdata(&i2s->pdev->dev, i2s);
		dev_set_drvdata(&i2s->pdev->dev, i2s);
	} else {	/* Create a new platform_device for Secondary */
	} else {	/* Create a new platform_device for Secondary */
		i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1);
		i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1);
		if (IS_ERR(i2s->pdev))
		if (!i2s->pdev)
			return NULL;
			return NULL;


		i2s->pdev->dev.parent = &pdev->dev;
		i2s->pdev->dev.parent = &pdev->dev;