* [PATCH] vmbus: unregister device_obj->channels_kset
@ 2017-11-13 1:53 ` Dexuan Cui
0 siblings, 0 replies; 4+ messages in thread
From: Dexuan Cui @ 2017-11-13 1:53 UTC (permalink / raw)
To: 'gregkh@linuxfoundation.org',
Stephen Hemminger, KY Srinivasan,
'driverdev-devel@linuxdriverproject.org'
Cc: linux-kernel
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 <decui@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] vmbus: unregister device_obj->channels_kset
@ 2017-11-13 1:53 ` Dexuan Cui
0 siblings, 0 replies; 4+ messages in thread
From: Dexuan Cui @ 2017-11-13 1:53 UTC (permalink / raw)
To: 'gregkh@linuxfoundation.org',
Stephen Hemminger, KY Srinivasan,
'driverdev-devel@linuxdriverproject.org'
Cc: linux-kernel
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 <decui@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] vmbus: unregister device_obj->channels_kset
2017-11-13 1:53 ` Dexuan Cui
@ 2017-11-13 16:16 ` Stephen Hemminger
-1 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-11-13 16:16 UTC (permalink / raw)
To: Dexuan Cui
Cc: 'gregkh@linuxfoundation.org',
Stephen Hemminger, KY Srinivasan,
'driverdev-devel@linuxdriverproject.org',
linux-kernel
On Mon, 13 Nov 2017 01:53:33 +0000
Dexuan Cui <decui@microsoft.com> wrote:
> 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 <decui@microsoft.com>
> Cc: Stephen Hemminger <sthemmin@microsoft.com>
> Cc: K. Y. Srinivasan <kys@microsoft.com>
> ---
Good catch
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vmbus: unregister device_obj->channels_kset
@ 2017-11-13 16:16 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-11-13 16:16 UTC (permalink / raw)
To: Dexuan Cui
Cc: 'gregkh@linuxfoundation.org',
Stephen Hemminger, KY Srinivasan,
'driverdev-devel@linuxdriverproject.org',
linux-kernel
On Mon, 13 Nov 2017 01:53:33 +0000
Dexuan Cui <decui@microsoft.com> wrote:
> 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 <decui@microsoft.com>
> Cc: Stephen Hemminger <sthemmin@microsoft.com>
> Cc: K. Y. Srinivasan <kys@microsoft.com>
> ---
Good catch
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-13 16:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13 1:53 [PATCH] vmbus: unregister device_obj->channels_kset Dexuan Cui
2017-11-13 1:53 ` Dexuan Cui
2017-11-13 16:16 ` Stephen Hemminger
2017-11-13 16:16 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.