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> --- drivers/block/xen-blkfront.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- 3.4-rc1/drivers/block/xen-blkfront.c +++ 3.4-rc1-xen-blkfront-exit-cleanup/drivers/block/xen-blkfront.c @@ -1497,7 +1497,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);