On 9/8/23 13:48, Sergey Shtylyov wrote:
--- scsi.orig/drivers/scsi/hosts.c
+++ scsi/drivers/scsi/hosts.c
@@ -272,7 +272,10 @@ int scsi_add_host_with_dma(struct Scsi_H
if (error)
goto out_disable_runtime_pm;
- scsi_host_set_state(shost, SHOST_RUNNING);
+ error = scsi_host_set_state(shost, SHOST_RUNNING);
+ if (error)
+ goto out_disable_runtime_pm;
+
get_device(shost->shost_gendev.parent);
device_enable_async_suspend(&shost->shost_dev);
The scsi_host_set_state(shost, SHOST_RUNNING) call shouldn't fail.
Hence, I think that adding error handling for the failure case will
confuse anyone who is reading that code.
Thanks,
Bart.