Yes, you are right. The ufshcd_init() and ufshcd_device_init() call scsi_add_host(). However, the ufs_device_init() already has the "hba->scsi_host_added = true" assignment. So, I added only one assignment. --------- Original Message --------- Sender : Bart Van Assche <bvanassche@xxxxxxx> Date : 2024-06-29 04:30 (GMT+9) Title : Re: [PATCH] ufs: core: Remove scsi host only if added On 6/27/24 7:18 PM, Kyoungrul Kim wrote: > Yes, scsi_add_host has been moved the async function (ufshcd_device_init)as MCQ patch applied. > So the ufshcd driver attaches the device without knowing whether the probe fails or not. > and if host tries to remove ufshcd driver, it makes kernel panic. > So it became necessary to check whether to add a host or not. There are two scsi_add_host() calls in the UFS driver and this patch only adds one "hba->scsi_host_added = true" assignment. Shouldn't this patch add two such assignments? Thanks, Bart.