Thread (23 messages) 23 messages, 6 authors, 2021-06-30

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

From: Hannes Reinecke <hare@suse.de>
Date: 2021-06-07 11:40:43

On 6/2/21 3:30 PM, 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 <redacted>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Ming Lei <redacted>
---
 drivers/scsi/hosts.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		        Kernel Storage Architect
hare@suse.de			               +49 911 74053 688
SUSE Software Solutions Germany GmbH, 90409 Nürnberg
GF: F. Imendörffer, HRB 36809 (AG Nürnberg)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help