[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170521011939.8111-1-weiyj.lk@gmail.com>
Date: Sun, 21 May 2017 01:19:39 +0000
From: Wei Yongjun <weiyj.lk@...il.com>
To: David Airlie <airlied@...ux.ie>, Dave Jiang <dave.jiang@...el.com>,
Miklos Szeredi <mszeredi@...hat.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Chris Wilson <chris@...is-wilson.co.uk>,
Sean Paul <seanpaul@...omium.org>,
Laura Abbott <labbott@...hat.com>,
Matthew Auld <matthew.auld@...el.com>
Cc: Wei Yongjun <weiyongjun1@...wei.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH -next] drm/vgem: Fix return value check in vgem_init()
From: Wei Yongjun <weiyongjun1@...wei.com>
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: 315f0242aa2b ("drm/vgem: Convert to a struct drm_device subclass")
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
drivers/gpu/drm/vgem/vgem_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 54ec94c..18f401b 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -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;
}
Powered by blists - more mailing lists