Re: [PATCH 3/4] scsi: core: put .shost_dev in failure path if host state becomes running

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/06/2021 14:30, Ming Lei wrote:
scsi_host_dev_release() only works around for us by freeing
dev_name(&shost->shost_dev) when host state is SHOST_CREATED. After host
state is changed to SHOST_RUNNING, scsi_host_dev_release() doesn't do
that any more.

So fix the issue by put .shost_dev in failure path if host state becomes
running, meantime move get_device(&shost->shost_gendev) before
device_add(&shost->shost_dev), so that scsi_host_cls_release() can put
this reference.

Reported-by: John Garry<john.garry@xxxxxxxxxx>
Cc: Bart Van Assche<bvanassche@xxxxxxx>
Cc: Hannes Reinecke<hare@xxxxxxx>
Signed-off-by: Ming Lei<ming.lei@xxxxxxxxxx>

Reviewed-by: John Garry <john.garry@xxxxxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux