File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -762,6 +762,8 @@ static int pf_detect(void)
762
762
763
763
printk ("%s: No ATAPI disk detected\n" , name );
764
764
for (pf = units , unit = 0 ; unit < PF_UNITS ; pf ++ , unit ++ ) {
765
+ if (!pf -> disk )
766
+ continue ;
765
767
blk_cleanup_queue (pf -> disk -> queue );
766
768
pf -> disk -> queue = NULL ;
767
769
blk_mq_free_tag_set (& pf -> tag_set );
@@ -1029,8 +1031,13 @@ static int __init pf_init(void)
1029
1031
pf_busy = 0 ;
1030
1032
1031
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
1039
put_disk (pf -> disk );
1040
+ }
1034
1041
return - EBUSY ;
1035
1042
}
1036
1043
@@ -1051,6 +1058,9 @@ static void __exit pf_exit(void)
1051
1058
int unit ;
1052
1059
unregister_blkdev (major , name );
1053
1060
for (pf = units , unit = 0 ; unit < PF_UNITS ; pf ++ , unit ++ ) {
1061
+ if (!pf -> disk )
1062
+ continue ;
1063
+
1054
1064
if (pf -> present )
1055
1065
del_gendisk (pf -> disk );
1056
1066
You can’t perform that action at this time.
0 commit comments