drm/vgem: Fix return value check in vgem_init()
Subsystems (2)
PATCH 1/1 drm/vgem: Fix return value check in vgem_init()
From: Wei Yongjun <[email protected]>
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().
--- drivers/gpu/drm/vgem/vgem_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vgem/vgem_drv.c +2 -2
@@ -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; }
Quoted 7 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
In case of error, the function
platform_device_register_simple()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().Fixes 315f0242aa2b ("drm/vgem: Convert to a struct drm_device subclass")
This is wrong, the bug was introduced in af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces") not that it matters since it is the same tag.
Quoted 1 line
Signed-off-by Wei Yongjun <[email protected]>
Checked it is an ERR_PTR return on failure, so
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Daniel Vetter
AppliedQuoted 7 lines · Chris Wilson
Quoted 6 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
In case of error, the function
platform_device_register_simple()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().
Quoted 5 lines
Quoted 1 line
Fixes 315f0242aa2b ("drm/vgem: Convert to a struct drm_device subclass")This is wrong, the bug was introduced in
af33a9190d02("drm/vgem: Enable dmabuf import interfaces") not that it matters since it is the same tag.
Fixed.
Quoted 4 lines
Quoted 1 line
Signed-off-by Wei Yongjun <[email protected]>Checked it is an
ERR_PTRreturn on failure, soReviewed-by Chris Wilson <[email protected]>
Applied, thanks for patch&review.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel