diff options
| author | Tom Gundersen <[email protected]> | 2016-09-21 14:59:19 +0000 |
|---|---|---|
| committer | Sean Paul <[email protected]> | 2016-09-22 11:03:48 +0000 |
| commit | 0f2886057be322ddfa4858384c40a505f7a32a4a (patch) | |
| tree | 95fd93e32cce031f99920cd1937b4e46491e65b3 /drivers/gpu/drm/drm_pci.c | |
| parent | drm: Distinguish no name from ENOMEM in set_unique() (diff) | |
| download | kernel-0f2886057be322ddfa4858384c40a505f7a32a4a.tar.gz kernel-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 <[email protected]>
Signed-off-by: Sean Paul <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/drm_pci.c')
| -rw-r--r-- | drivers/gpu/drm/drm_pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index d86362fc8ac6..3ceea9cb9d3e 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -236,8 +236,8 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, DRM_DEBUG("\n"); dev = drm_dev_alloc(driver, &pdev->dev); - if (!dev) - return -ENOMEM; + if (IS_ERR(dev)) + return PTR_ERR(dev); ret = pci_enable_device(pdev); if (ret) |
