diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-12-09 00:50:22 +0100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-12-11 08:28:52 +0100 |
commit | 2c3f0eddfbd7f5c7a5450de287bad805722888c3 (patch) | |
tree | 5ff4fe994fe815b7e497374acb242937055f2174 /drivers/char/drm | |
parent | drm: fix return value check (diff) | |
download | linux-2c3f0eddfbd7f5c7a5450de287bad805722888c3.tar.xz linux-2c3f0eddfbd7f5c7a5450de287bad805722888c3.zip |
DRM: handle pci_enable_device failure
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r-- | drivers/char/drm/drm_stub.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c index 5fd6dc0870cf..120d10256feb 100644 --- a/drivers/char/drm/drm_stub.c +++ b/drivers/char/drm/drm_stub.c @@ -211,14 +211,16 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, if (!dev) return -ENOMEM; - pci_enable_device(pdev); + ret = pci_enable_device(pdev); + if (ret) + goto err_g1; if ((ret = drm_fill_in_dev(dev, pdev, ent, driver))) { printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); - goto err_g1; + goto err_g2; } if ((ret = drm_get_head(dev, &dev->primary))) - goto err_g1; + goto err_g2; DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name, driver->major, driver->minor, driver->patchlevel, @@ -226,7 +228,9 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, return 0; - err_g1: +err_g2: + pci_disable_device(pdev); +err_g1: drm_free(dev, sizeof(*dev), DRM_MEM_STUB); return ret; } |