diff mbox series

scsi: pm80xx: fix error return code in pm8001_pci_probe()

Message ID 20230725125706.566990-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Headers show
Series scsi: pm80xx: fix error return code in pm8001_pci_probe() | expand

Commit Message

Yang Yingliang July 25, 2023, 12:57 p.m. UTC
If pm8001_init_sas_add() fails, return error code in pm8001_pci_probe().

Fixes: 14a8f116cdc0 ("scsi: pm80xx: Add GET_NVMD timeout during probe")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/scsi/pm8001/pm8001_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Igor Pylypiv July 25, 2023, 7:31 p.m. UTC | #1
On Tue, Jul 25, 2023 at 08:57:06PM +0800, Yang Yingliang wrote:
> If pm8001_init_sas_add() fails, return error code in pm8001_pci_probe().
> 
> Fixes: 14a8f116cdc0 ("scsi: pm80xx: Add GET_NVMD timeout during probe")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Igor Pylypiv <ipylypiv@google.com>

> ---
>  drivers/scsi/pm8001/pm8001_init.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
> index 2e886c1d867d..4995e1ef4e0e 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -1181,7 +1181,8 @@ static int pm8001_pci_probe(struct pci_dev *pdev,
>  		pm80xx_set_thermal_config(pm8001_ha);
>  	}
>  
> -	if (pm8001_init_sas_add(pm8001_ha))
> +	rc = pm8001_init_sas_add(pm8001_ha);
> +	if (rc)
>  		goto err_out_shost;
>  	/* phy setting support for motherboard controller */
>  	rc = pm8001_configure_phy_settings(pm8001_ha);
> -- 
> 2.25.1
>
Martin K. Petersen July 26, 2023, 2:03 a.m. UTC | #2
On Tue, 25 Jul 2023 20:57:06 +0800, Yang Yingliang wrote:

> If pm8001_init_sas_add() fails, return error code in pm8001_pci_probe().
> 
> 

Applied to 6.5/scsi-fixes, thanks!

[1/1] scsi: pm80xx: fix error return code in pm8001_pci_probe()
      https://git.kernel.org/mkp/scsi/c/d4e026534577
diff mbox series

Patch

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 2e886c1d867d..4995e1ef4e0e 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -1181,7 +1181,8 @@  static int pm8001_pci_probe(struct pci_dev *pdev,
 		pm80xx_set_thermal_config(pm8001_ha);
 	}
 
-	if (pm8001_init_sas_add(pm8001_ha))
+	rc = pm8001_init_sas_add(pm8001_ha);
+	if (rc)
 		goto err_out_shost;
 	/* phy setting support for motherboard controller */
 	rc = pm8001_configure_phy_settings(pm8001_ha);