Browse Source

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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>
isee-imx_3.14.28.y
Wei Yongjun 7 years ago
committed by Mark Brown
parent
commit
29ca9c73e5
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      sound/soc/samsung/i2s.c

+ 1
- 1
sound/soc/samsung/i2s.c View File

@ -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;


Loading…
Cancel
Save