diff options
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, | |||
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: | 231 | err_g2: |
232 | pci_disable_device(pdev); | ||
233 | err_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 | } |