[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 8 Aug 2018 16:14:22 +0800
From: piaojun <piaojun@...wei.com>
To: Dominique Martinet <asmadeus@...ewreck.org>
CC: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"Eric Van Hensbergen" <ericvh@...il.com>,
Ron Minnich <rminnich@...dia.gov>,
"Latchesar Ionkov" <lucho@...kov.net>, Greg Kurz <groug@...d.org>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
<v9fs-developer@...ts.sourceforge.net>
Subject: [PATCH] net/9p/trans_virtio.c: decrease the refcount of 9p virtio
device when removing it
I found that 9pnet_virtio.ko could not be removed by rmmod command, and I
could still found it by lsmod. The reason is that we forgot decrease the
refcount of 9p virtio device by kobject_put. So we should put refcount in
p9_virtio_remove.
Signed-off-by: Jun Piao <piaojun@...wei.com>
---
net/9p/trans_virtio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 46a5ab2..a00e992 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -710,7 +710,8 @@ static void p9_virtio_remove(struct virtio_device *vdev)
vdev->config->del_vqs(vdev);
sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr);
- kobject_uevent(&(vdev->dev.kobj), KOBJ_CHANGE);
+ kobject_uevent(&(vdev->dev.kobj), KOBJ_REMOVE);
+ kobject_put(&(vdev->dev.kobj));
kfree(chan->tag);
kfree(chan->vc_wq);
kfree(chan);
--
Powered by blists - more mailing lists