summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2013-10-30 11:59:05 +0100
committerDave Airlie <airlied@redhat.com>2013-10-30 21:33:49 +0100
commit9d6104e0174b130ed864571b31811c3fd09fd611 (patch)
tree00ac8c1893076529a62f90cf2a236ef338d16fd3 /drivers/gpu/drm
parentMerge tag 'drm-intel-next-2013-10-18' of git://people.freedesktop.org/~danvet... (diff)
downloadlinux-9d6104e0174b130ed864571b31811c3fd09fd611.tar.xz
linux-9d6104e0174b130ed864571b31811c3fd09fd611.zip
drm/sysfs: Do not drop device reference twice
device_unregister() already drops its reference to the struct device, so explicitly calling put_device() before device_unregister() can cause the device to have been freed before it can be unregistered. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Tested-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_sysfs.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index dae42c79154f..db1c8f958bab 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -439,7 +439,6 @@ err_out_files:
device_remove_file(connector->kdev, &connector_attrs_opt1[i]);
for (i = 0; i < attr_cnt; i++)
device_remove_file(connector->kdev, &connector_attrs[i]);
- put_device(connector->kdev);
device_unregister(connector->kdev);
out:
@@ -472,7 +471,6 @@ void drm_sysfs_connector_remove(struct drm_connector *connector)
for (i = 0; i < ARRAY_SIZE(connector_attrs); i++)
device_remove_file(connector->kdev, &connector_attrs[i]);
sysfs_remove_bin_file(&connector->kdev->kobj, &edid_attr);
- put_device(connector->kdev);
device_unregister(connector->kdev);
connector->kdev = NULL;
}