summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/9p/trans_virtio.c8
-rw-r--r--net/9p/trans_xen.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 549938af02e7..a3cd90a74012 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -767,10 +767,16 @@ static struct p9_trans_module p9_virtio_trans = {
767/* The standard init function */ 767/* The standard init function */
768static int __init p9_virtio_init(void) 768static int __init p9_virtio_init(void)
769{ 769{
770 int rc;
771
770 INIT_LIST_HEAD(&virtio_chan_list); 772 INIT_LIST_HEAD(&virtio_chan_list);
771 773
772 v9fs_register_trans(&p9_virtio_trans); 774 v9fs_register_trans(&p9_virtio_trans);
773 return register_virtio_driver(&p9_virtio_drv); 775 rc = register_virtio_driver(&p9_virtio_drv);
776 if (rc)
777 v9fs_unregister_trans(&p9_virtio_trans);
778
779 return rc;
774} 780}
775 781
776static void __exit p9_virtio_cleanup(void) 782static void __exit p9_virtio_cleanup(void)
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
index 29420ebb8f07..3963eb11c3fb 100644
--- a/net/9p/trans_xen.c
+++ b/net/9p/trans_xen.c
@@ -530,13 +530,19 @@ static struct xenbus_driver xen_9pfs_front_driver = {
530 530
531static int p9_trans_xen_init(void) 531static int p9_trans_xen_init(void)
532{ 532{
533 int rc;
534
533 if (!xen_domain()) 535 if (!xen_domain())
534 return -ENODEV; 536 return -ENODEV;
535 537
536 pr_info("Initialising Xen transport for 9pfs\n"); 538 pr_info("Initialising Xen transport for 9pfs\n");
537 539
538 v9fs_register_trans(&p9_xen_trans); 540 v9fs_register_trans(&p9_xen_trans);
539 return xenbus_register_frontend(&xen_9pfs_front_driver); 541 rc = xenbus_register_frontend(&xen_9pfs_front_driver);
542 if (rc)
543 v9fs_unregister_trans(&p9_xen_trans);
544
545 return rc;
540} 546}
541module_init(p9_trans_xen_init); 547module_init(p9_trans_xen_init);
542 548