提交 eacd9aa9 编写于 作者: W Wei Yongjun 提交者: Benjamin Gaignard

drm: sti: Fix return value check in sti_drm_platform_probe()

In case of error, the function platform_device_register_resndata()
returns ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
上级 5024a2b7
...@@ -201,8 +201,8 @@ static int sti_drm_platform_probe(struct platform_device *pdev) ...@@ -201,8 +201,8 @@ static int sti_drm_platform_probe(struct platform_device *pdev)
master = platform_device_register_resndata(dev, master = platform_device_register_resndata(dev,
DRIVER_NAME "__master", -1, DRIVER_NAME "__master", -1,
NULL, 0, NULL, 0); NULL, 0, NULL, 0);
if (!master) if (IS_ERR(master))
return -EINVAL; return PTR_ERR(master);
platform_set_drvdata(pdev, master); platform_set_drvdata(pdev, master);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册