aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_stub.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index e8c2fd4c5e65..b9631e3a1ea6 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -402,14 +402,14 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
402 if (dev->driver->load) { 402 if (dev->driver->load) {
403 ret = dev->driver->load(dev, ent->driver_data); 403 ret = dev->driver->load(dev, ent->driver_data);
404 if (ret) 404 if (ret)
405 goto err_g3; 405 goto err_g4;
406 } 406 }
407 407
408 /* setup the grouping for the legacy output */ 408 /* setup the grouping for the legacy output */
409 if (drm_core_check_feature(dev, DRIVER_MODESET)) { 409 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
410 ret = drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group); 410 ret = drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
411 if (ret) 411 if (ret)
412 goto err_g3; 412 goto err_g4;
413 } 413 }
414 414
415 list_add_tail(&dev->driver_item, &driver->device_list); 415 list_add_tail(&dev->driver_item, &driver->device_list);
@@ -420,8 +420,11 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
420 420
421 return 0; 421 return 0;
422 422
423err_g3: 423err_g4:
424 drm_put_minor(&dev->primary); 424 drm_put_minor(&dev->primary);
425err_g3:
426 if (drm_core_check_feature(dev, DRIVER_MODESET))
427 drm_put_minor(&dev->control);
425err_g2: 428err_g2:
426 pci_disable_device(pdev); 429 pci_disable_device(pdev);
427err_g1: 430err_g1: