2017-11-13 01:54:35

by Dexuan Cui

[permalink] [raw]
Subject: [PATCH] vmbus: unregister device_obj->channels_kset


Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info")

Without the patch, a device can't be thoroughly destroyed, because
vmbus_device_register() -> kset_create_and_add() still holds a reference
to the hv_device's device.kobj.

Signed-off-by: Dexuan Cui <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: K. Y. Srinivasan <[email protected]>
---

The patch is based on char-misc.git's char-misc-next branch.

drivers/hv/vmbus_drv.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 6a86746..4f3faf5 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1378,6 +1378,8 @@ void vmbus_device_unregister(struct hv_device *device_obj)
pr_debug("child device %s unregistered\n",
dev_name(&device_obj->device));

+ kset_unregister(device_obj->channels_kset);
+
/*
* Kick off the process of unregistering the device.
* This will call vmbus_remove() and eventually vmbus_device_release()
--
2.7.4


From 1584232886430719602@xxx Thu Nov 16 14:23:34 +0000 2017
X-GM-THRID: 1584232886430719602
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread