]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
xen-blkfront: module exit handling adjustments
authorJan Beulich <JBeulich@suse.com>
Thu, 5 Apr 2012 15:04:52 +0000 (16:04 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 11 May 2012 20:11:54 +0000 (16:11 -0400)
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 <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkfront.c

index 4f2b460529762502dcd03e4fdad1b7e1e05804f0..60eed4bdd2e4528ae3c3b8871cd65f85d3c34952 100644 (file)
@@ -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);