From 2b6cabce3954be3341e0fe7b20a27902821fd3dd Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Mon, 27 Sep 2021 15:01:08 -0700 Subject: [PATCH] pcd: fix ordering of unregister_cdrom() We first register cdrom and then we add_disk() and so we we should likewise unregister the cdrom first and then del_gendisk(). Signed-off-by: Luis Chamberlain Signed-off-by: Jens Axboe --- drivers/block/paride/pcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index a7fab38..82a654f 100644 --- a/drivers/block/paride/pcd.c +++ b/drivers/block/paride/pcd.c @@ -1021,9 +1021,9 @@ static void __exit pcd_exit(void) if (!cd->present) continue; + unregister_cdrom(&cd->info); del_gendisk(cd->disk); pi_release(cd->pi); - unregister_cdrom(&cd->info); blk_cleanup_disk(cd->disk); blk_mq_free_tag_set(&cd->tag_set); -- 2.7.4