提交 77d26dc9 编写于 作者: M Ma Ling 提交者: 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: NMa Ling <ling.ma@intel.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册