diff options
| -rw-r--r-- | drivers/block/paride/pf.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index 103b617cdc31..35e6e271b219 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c | |||
| @@ -762,6 +762,8 @@ static int pf_detect(void) | |||
| 762 | 762 | ||
| 763 | printk("%s: No ATAPI disk detected\n", name); | 763 | printk("%s: No ATAPI disk detected\n", name); |
| 764 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { | 764 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { |
| 765 | if (!pf->disk) | ||
| 766 | continue; | ||
| 765 | blk_cleanup_queue(pf->disk->queue); | 767 | blk_cleanup_queue(pf->disk->queue); |
| 766 | pf->disk->queue = NULL; | 768 | pf->disk->queue = NULL; |
| 767 | blk_mq_free_tag_set(&pf->tag_set); | 769 | blk_mq_free_tag_set(&pf->tag_set); |
| @@ -1029,8 +1031,13 @@ static int __init pf_init(void) | |||
| 1029 | pf_busy = 0; | 1031 | pf_busy = 0; |
| 1030 | 1032 | ||
| 1031 | if (register_blkdev(major, name)) { | 1033 | if (register_blkdev(major, name)) { |
| 1032 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) | 1034 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { |
| 1035 | if (!pf->disk) | ||
| 1036 | continue; | ||
| 1037 | blk_cleanup_queue(pf->disk->queue); | ||
| 1038 | blk_mq_free_tag_set(&pf->tag_set); | ||
| 1033 | put_disk(pf->disk); | 1039 | put_disk(pf->disk); |
| 1040 | } | ||
| 1034 | return -EBUSY; | 1041 | return -EBUSY; |
| 1035 | } | 1042 | } |
| 1036 | 1043 | ||
| @@ -1051,6 +1058,9 @@ static void __exit pf_exit(void) | |||
| 1051 | int unit; | 1058 | int unit; |
| 1052 | unregister_blkdev(major, name); | 1059 | unregister_blkdev(major, name); |
| 1053 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { | 1060 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { |
| 1061 | if (!pf->disk) | ||
| 1062 | continue; | ||
| 1063 | |||
| 1054 | if (pf->present) | 1064 | if (pf->present) |
| 1055 | del_gendisk(pf->disk); | 1065 | del_gendisk(pf->disk); |
| 1056 | 1066 | ||
