aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_stub.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-12-08 18:50:22 -0500
committerDave Airlie <airlied@linux.ie>2006-12-11 02:28:52 -0500
commit2c3f0eddfbd7f5c7a5450de287bad805722888c3 (patch)
tree5ff4fe994fe815b7e497374acb242937055f2174 /drivers/char/drm/drm_stub.c
parent94f060bd0f78814f4daf8c7942bd710af52c7d6f (diff)
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/drm_stub.c')
-rw-r--r--drivers/char/drm/drm_stub.c12
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,
211 if (!dev) 211 if (!dev)
212 return -ENOMEM; 212 return -ENOMEM;
213 213
214 pci_enable_device(pdev); 214 ret = pci_enable_device(pdev);
215 if (ret)
216 goto err_g1;
215 217
216 if ((ret = drm_fill_in_dev(dev, pdev, ent, driver))) { 218 if ((ret = drm_fill_in_dev(dev, pdev, ent, driver))) {
217 printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); 219 printk(KERN_ERR "DRM: Fill_in_dev failed.\n");
218 goto err_g1; 220 goto err_g2;
219 } 221 }
220 if ((ret = drm_get_head(dev, &dev->primary))) 222 if ((ret = drm_get_head(dev, &dev->primary)))
221 goto err_g1; 223 goto err_g2;
222 224
223 DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", 225 DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
224 driver->name, driver->major, driver->minor, driver->patchlevel, 226 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,
226 228
227 return 0; 229 return 0;
228 230
229 err_g1: 231err_g2:
232 pci_disable_device(pdev);
233err_g1:
230 drm_free(dev, sizeof(*dev), DRM_MEM_STUB); 234 drm_free(dev, sizeof(*dev), DRM_MEM_STUB);
231 return ret; 235 return ret;
232} 236}