Commit 77d26dc9 authored by Ma Ling's avatar Ma Ling Committed by Dave Airlie

drm: clean dirty memory after device release

In current code we register/unregister connector object by
drm_sysfs_connector_add/remove function.

However under some cases, we need to dynamically register or unregister device
multiple times, so we have to go through register -> unregister ->register
routine.

Because after device_unregister function our memory is dirty, we need to do
clean operation in order to re-register the device, otherwise the system
will crash.  The patch intends to clean device after device release.
Signed-off-by: default avatarMa Ling <ling.ma@intel.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent d9c6f546
...@@ -132,6 +132,7 @@ void drm_sysfs_destroy(void) ...@@ -132,6 +132,7 @@ void drm_sysfs_destroy(void)
*/ */
static void drm_sysfs_device_release(struct device *dev) static void drm_sysfs_device_release(struct device *dev)
{ {
memset(dev, 0, sizeof(struct device));
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment