Skip to contentSkip to conversation

scsi: megarad: Fix the return value of the probe function

PATCH New Zheyu Ma 1 participant 1 message Oct 20, 2021

Subsystems (2)
lore
Share & tools
lore

Zheyu Ma

author
#0 lore raw

PATCH 1/1 scsi: megarad: Fix the return value of the probe function

During the process of driver probing, the probe function should return < 0 for failure, otherwise, the kernel will treat value > 0 as success.

---
 drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +1 -1
index e4298bf4a482..b94f9557b2fa 100644
@@ -7468,7 +7468,7 @@ static int megasas_probe_one(struct pci_dev *pdev,
 	case PCI_DEVICE_ID_LSI_AERO_10E4:
 	case PCI_DEVICE_ID_LSI_AERO_10E7:
 		dev_err(&pdev->dev, "Adapter is in non secure mode\n");
-		return 1;
+		return -ENODEV;
 	case PCI_DEVICE_ID_LSI_AERO_10E1:
 	case PCI_DEVICE_ID_LSI_AERO_10E5:
 		dev_info(&pdev->dev, "Adapter is in configurable secure mode\n");
Signature · 1 line
2.17.6