Commit 7cbff57
scsi: ufs: core: Remove SCSI host only if added
If host tries to remove ufshcd driver from a UFS device it would cause a
kernel panic if ufshcd_async_scan fails during ufshcd_probe_hba before
adding a SCSI host with scsi_add_host and MCQ is enabled since SCSI host
has been defered after MCQ configuration introduced by commit 0cab402
("scsi: ufs: core: Defer adding host to SCSI if MCQ is supported").
To guarantee that SCSI host is removed only if it has been added, set the
scsi_host_added flag to true after adding a SCSI host and check whether it
is set or not before removing it.
Signed-off-by: Kyoungrul Kim <[email protected]>
Signed-off-by: Minwoo Im <[email protected]>
Link: https://lore.kernel.org/r/20240627085104epcms2p5897a3870ea5c6416aa44f94df6c543d7@epcms2p5
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent ed7dac8 commit 7cbff57
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10216 | 10216 | | |
10217 | 10217 | | |
10218 | 10218 | | |
10219 | | - | |
| 10219 | + | |
| 10220 | + | |
10220 | 10221 | | |
10221 | 10222 | | |
10222 | 10223 | | |
| |||
10495 | 10496 | | |
10496 | 10497 | | |
10497 | 10498 | | |
| 10499 | + | |
10498 | 10500 | | |
10499 | 10501 | | |
10500 | 10502 | | |
| |||
10577 | 10579 | | |
10578 | 10580 | | |
10579 | 10581 | | |
10580 | | - | |
| 10582 | + | |
| 10583 | + | |
10581 | 10584 | | |
10582 | 10585 | | |
10583 | 10586 | | |
| |||
0 commit comments