[PATCH v2 13/15] pcd: fix ordering of unregister_cdrom()

From: Luis Chamberlain
Date: Mon Sep 27 2021 - 18:02:46 EST


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 <mcgrof@xxxxxxxxxx>
---
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 a7fab3830d7b..82a654fc4db8 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.30.2