sparc/kernel/vio.c: add put_device() after device_find_child()
RFC PATCH 1/1 sparc/kernel/vio.c: add put_device() after device_find_child()
The vio_remove() function uses device_find_child() but it does not drop the reference of the retrieved child.
Signed-off-by Federico Vaga <[email protected]>
---
I do not have a SPARC system (and I do not know it), so I cannot test this patch. Please test it.
If I'm right, the device_unregister() does not work properly because, device_find_child() did get_device() on dev. In essence, the release method associated to the device will never be invoked because there is a reference to the device that is not dropped.
arch/sparc/kernel/vio.c | 1 + 1 file changed, 1 insertion(+)
arch/sparc/kernel/vio.c +1 -0
@@ -342,6 +342,7 @@ static void vio_remove(struct mdesc_handle *hp, u64 node)printk (KERN_INFO "VIO: Removing device %s\n" ,dev_name (dev));device_unregister (dev); +put_device (dev); } }
Signature · 1 line
1.8.1.4
From: Federico Vaga <[email protected]>
Date: Mon, 15 Apr 2013 16:42:52 +0200
Quoted 4 lines
The
vio_remove()function usesdevice_find_child()but it does not drop the reference of the retrieved child.Signed-off-by Federico Vaga <[email protected]>
Applied.