Skip to content

Commit e8fa49b

Browse files
Wei Yongjundanvet
authored andcommitted
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: af33a91 ("drm/vgem: Enable dmabuf import interfaces") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> [danvet: Fix fixes: tag per Chris' review.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170521011939.8111-1-weiyj.lk@gmail.com
1 parent a18e662 commit e8fa49b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/gpu/drm/vgem/vgem_drv.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ static int __init vgem_init(void)
438438

439439
vgem_device->platform =
440440
platform_device_register_simple("vgem", -1, NULL, 0);
441-
if (!vgem_device->platform) {
442-
ret = -ENODEV;
441+
if (IS_ERR(vgem_device->platform)) {
442+
ret = PTR_ERR(vgem_device->platform);
443443
goto out_fini;
444444
}
445445

0 commit comments

Comments
 (0)