提交 e8fa49b5 编写于 作者: W Wei Yongjun 提交者: Daniel Vetter

drm/vgem: Fix return value check in vgem_init()

In case of error, the function platform_device_register_simple() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Fixes: af33a919 ("drm/vgem: Enable dmabuf import interfaces")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
[danvet: Fix fixes: tag per Chris' review.]
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170521011939.8111-1-weiyj.lk@gmail.com
上级 a18e6621
......@@ -438,8 +438,8 @@ static int __init vgem_init(void)
vgem_device->platform =
platform_device_register_simple("vgem", -1, NULL, 0);
if (!vgem_device->platform) {
ret = -ENODEV;
if (IS_ERR(vgem_device->platform)) {
ret = PTR_ERR(vgem_device->platform);
goto out_fini;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册