From mboxrd@z Thu Jan 1 00:00:00 1970 From: Noboru Iwamatsu Subject: Re: [PATCH] linux/usbback: fix usbstub_exit() placement Date: Fri, 16 Oct 2009 10:00:51 +0900 Message-ID: <4AD7C5C3.7080001@jp.fujitsu.com> References: <4AD730BE020000780001A13C@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4AD730BE020000780001A13C@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 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);