Skip to content

Commit

Permalink
xen-blkfront: module exit handling adjustments
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Beulich authored and Konrad Rzeszutek Wilk committed May 11, 2012
1 parent e77c78c commit 8605067
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8605067

Please sign in to comment.