On 7/8/20 1:08 PM, John Garry wrote: > On 03/07/2020 14:01, Hannes Reinecke wrote: >> ret = scsi_add_host(shost, &pdev->dev); >> if (ret) { >> @@ -313,6 +314,12 @@ snic_add_host(struct Scsi_Host *shost, struct >> pci_dev *pdev) >> return ret; >> } >> + snic->shost_dev = scsi_get_host_dev(shost); >> + if (!snic->shost_dev) { >> + SNIC_HOST_ERR(shost, >> + "snic: scsi_get_virtual_dev failed\n"); >> + return -ENOMEM; >> + } >> SNIC_BUG_ON(shost->work_q != NULL); >> snprintf(shost->work_q_name, sizeof(shost->work_q_name), >> "scsi_wq_%d", >> shost->host_no); > > do we need scsi_free_host_dev() for error paths and teardown paths? That > applies to fnic as well. Or is this done in the scsi_host teardown (I > didn't check)? > This is done in scsi_host teardown. With this patchset host device appear just like normal SCSI devices, so host teardown will remove those, too. That's the gist of those patches to revamp scsi host device handling. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer