Re: scsi: hosts: check result of scsi_host_set_state() in scsi_add_host_with_dma()

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

 



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.



[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