mirror of
https://github.com/torvalds/linux.git
synced 2026-04-27 11:02:31 -04:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user