projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d454854
)
9p/xen: Add cleanup path in p9_trans_xen_init
author
YueHaibing
<yuehaibing@huawei.com>
Tue, 30 Apr 2019 14:39:33 +0000
(22:39 +0800)
committer
Dominique Martinet
<dominique.martinet@cea.fr>
Wed, 15 May 2019 13:00:07 +0000
(13:00 +0000)
If xenbus_register_frontend() fails in p9_trans_xen_init,
we should call v9fs_unregister_trans() to do cleanup.
Link:
http://lkml.kernel.org/r/20190430143933.19368-1-yuehaibing@huawei.com
Cc: stable@vger.kernel.org
Fixes:
868eb122739a
("xen/9pfs: introduce Xen 9pfs transport driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
net/9p/trans_xen.c
patch
|
blob
|
blame
|
history
diff --git
a/net/9p/trans_xen.c
b/net/9p/trans_xen.c
index e2fbf3677b9baf3fa99ba98485f73caf0118f249..9daab0dd833b31cbb663b7756970a545cc59f3cf 100644
(file)
--- a/
net/9p/trans_xen.c
+++ b/
net/9p/trans_xen.c
@@
-530,13
+530,19
@@
static struct xenbus_driver xen_9pfs_front_driver = {
static int p9_trans_xen_init(void)
{
+ int rc;
+
if (!xen_domain())
return -ENODEV;
pr_info("Initialising Xen transport for 9pfs\n");
v9fs_register_trans(&p9_xen_trans);
- return xenbus_register_frontend(&xen_9pfs_front_driver);
+ rc = xenbus_register_frontend(&xen_9pfs_front_driver);
+ if (rc)
+ v9fs_unregister_trans(&p9_xen_trans);
+
+ return rc;
}
module_init(p9_trans_xen_init);