Skip to content

Commit 1e0d4e6

Browse files
Ming Leimartinkpetersen
authored andcommitted
scsi: core: Only put parent device if host state differs from SHOST_CREATED
get_device(shost->shost_gendev.parent) is called after host state has switched to SHOST_RUNNING. scsi_host_dev_release() shouldn't release the parent device if host state is still SHOST_CREATED. Link: https://lore.kernel.org/r/[email protected] Cc: Bart Van Assche <[email protected]> Cc: John Garry <[email protected]> Cc: Hannes Reinecke <[email protected]> Tested-by: John Garry <[email protected]> Reviewed-by: John Garry <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1171402 commit 1e0d4e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/hosts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static void scsi_host_dev_release(struct device *dev)
347347

348348
ida_simple_remove(&host_index_ida, shost->host_no);
349349

350-
if (parent)
350+
if (shost->shost_state != SHOST_CREATED)
351351
put_device(parent);
352352
kfree(shost);
353353
}

0 commit comments

Comments
 (0)