From: Jan Beulich Date: Thu, 5 Apr 2012 15:04:52 +0000 (+0100) Subject: xen-blkfront: module exit handling adjustments X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8605067fb9b8e34aecf44ec258657c9cc009fc5a;p=openwrt%2Fstaging%2Fblogic.git xen-blkfront: module exit handling adjustments The blkdev major must be released upon exit, or else the module can't attach to devices using the same majors upon being loaded again. Also avoid leaking the minor tracking bitmap. Signed-off-by: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 4f2b46052976..60eed4bdd2e4 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1500,7 +1500,9 @@ module_init(xlblk_init); static void __exit xlblk_exit(void) { - return xenbus_unregister_driver(&blkfront_driver); + xenbus_unregister_driver(&blkfront_driver); + unregister_blkdev(XENVBD_MAJOR, DEV_NAME); + kfree(minors); } module_exit(xlblk_exit);