WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] linux/usbback: fix usbstub_exit() placement

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] linux/usbback: fix usbstub_exit() placement
From: Noboru Iwamatsu <n_iwamatsu@xxxxxxxxxxxxxx>
Date: Fri, 16 Oct 2009 10:00:51 +0900
Delivery-date: Thu, 15 Oct 2009 18:01:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4AD730BE020000780001A13C@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4AD730BE020000780001A13C@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)
Hi,

Jan Beulich wrote:
> The function is being referenced from (non-__exit) usbback_init().

No, usbstub_exit() is only referenced from usbback_exit() in the
latest version.

Are you suggesting that usbstub_exit() should be referenced from usbback_init() and should do as follows?


Signed-off-by: Noboru Iwamatsu <n_iwamatsu@xxxxxxxxxxxxxx>

diff -r ba13757d92ce drivers/xen/usbback/usbback.c
--- a/drivers/xen/usbback/usbback.c     Thu Oct 08 15:37:22 2009 +0900
+++ b/drivers/xen/usbback/usbback.c     Fri Oct 16 09:35:28 2009 +0900
@@ -1123,12 +1123,13 @@

        return 0;

- out_of_memory:
-        kfree(pending_reqs);
-        kfree(pending_grant_handles);
-        free_empty_pages_and_pagevec(pending_pages, mmap_pages);
-        printk("%s: out of memory\n", __FUNCTION__);
-        return -ENOMEM;
+out_of_memory:
+       usbstub_exit();
+       kfree(pending_reqs);
+       kfree(pending_grant_handles);
+       free_empty_pages_and_pagevec(pending_pages, mmap_pages);
+       printk("%s: out of memory\n", __FUNCTION__);
+       return -ENOMEM;
 }

 static void __exit usbback_exit(void)
diff -r ba13757d92ce drivers/xen/usbback/usbstub.c
--- a/drivers/xen/usbback/usbstub.c     Thu Oct 08 15:37:22 2009 +0900
+++ b/drivers/xen/usbback/usbstub.c     Fri Oct 16 09:35:28 2009 +0900
@@ -317,7 +317,7 @@
        return err;
 }

-void __exit usbstub_exit(void)
+void usbstub_exit(void)
 {
        driver_remove_file(&usbback_usb_driver.driver,
                                &driver_attr_port_ids);




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel