aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-03-02 10:37:44 +1000
committerDave Airlie <airlied@redhat.com>2009-04-24 15:09:25 +1000
commit3788f48a0fad246dbab826e8b2f07b403b0e3279 (patch)
tree7396ee3dc83c405d0d7ed8e05de4c87ac705b020 /drivers
parent30ddbd94401a132f4d932775d1902b3c9a8c41b5 (diff)
downloadkernel_goldelico_gta04-3788f48a0fad246dbab826e8b2f07b403b0e3279.zip
kernel_goldelico_gta04-3788f48a0fad246dbab826e8b2f07b403b0e3279.tar.gz
kernel_goldelico_gta04-3788f48a0fad246dbab826e8b2f07b403b0e3279.tar.bz2
drm: cleanup properly in drm_get_dev() failure paths
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-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 e8c2fd4..b9631e3 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,
if (dev->driver->load) {
ret = dev->driver->load(dev, ent->driver_data);
if (ret)
- goto err_g3;
+ goto err_g4;
}
/* setup the grouping for the legacy output */
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
ret = drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
if (ret)
- goto err_g3;
+ goto err_g4;
}
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,
return 0;
-err_g3:
+err_g4:
drm_put_minor(&dev->primary);
+err_g3:
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ drm_put_minor(&dev->control);
err_g2:
pci_disable_device(pdev);
err_g1: