summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio
diff options
context:
space:
mode:
authorTom Gundersen2016-09-21 16:59:19 +0200
committerSean Paul2016-09-22 13:03:48 +0200
commit0f2886057be322ddfa4858384c40a505f7a32a4a (patch)
tree95fd93e32cce031f99920cd1937b4e46491e65b3 /drivers/gpu/drm/virtio
parentdrm: Distinguish no name from ENOMEM in set_unique() (diff)
downloadkernel-qcow2-linux-0f2886057be322ddfa4858384c40a505f7a32a4a.tar.gz
kernel-qcow2-linux-0f2886057be322ddfa4858384c40a505f7a32a4a.tar.xz
kernel-qcow2-linux-0f2886057be322ddfa4858384c40a505f7a32a4a.zip
drm: Don't swallow error codes in drm_dev_alloc()
There are many reasons other than ENOMEM that drm_dev_init() can fail. Return ERR_PTR rather than NULL to be able to distinguish these in the caller. Signed-off-by: Tom Gundersen <teg@jklm.no> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-2-teg@jklm.no
Diffstat (limited to 'drivers/gpu/drm/virtio')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_drm_bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
index a59d0e309bfc..26197dd95d5c 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
@@ -54,8 +54,8 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
int ret;
dev = drm_dev_alloc(driver, &vdev->dev);
- if (!dev)
- return -ENOMEM;
+ if (IS_ERR(dev))
+ return PTR_ERR(dev);
dev->virtdev = vdev;
vdev->priv = dev;